linux-uconsole/drivers/firmware
Wen Yang 372098d54b firmware: arm_scmi: Avoid double free in error flow
[ Upstream commit 8305e90a89 ]

If device_register() fails, both put_device() and kfree() are called,
ending with a double free of the scmi_dev.

Calling kfree() is needed only when a failure happens between the
allocation of the scmi_dev and its registration, so move it to there
and remove it from the error flow.

Fixes: 46edb8d132 ("firmware: arm_scmi: provide the mandatory device release callback")
Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-17 20:35:52 +01:00
..
arm_scmi firmware: arm_scmi: Avoid double free in error flow 2019-12-17 20:35:52 +01:00
broadcom firmware: bcm47xx_nvram: Support small (0x6000 B) NVRAM partitions 2018-04-23 16:39:35 +01:00
efi efi/cper: Fix endianness of PCIe class code 2019-11-06 13:05:52 +01:00
google gsmi: Fix bug in append_to_eventlog sysfs handler 2019-12-01 09:16:22 +01:00
meson firmware: meson-sm: rework meson_sm_init to use module_platform_driver_probe 2018-03-07 17:33:52 -08:00
tegra firmware: tegra: adjust tested variable 2018-03-08 14:43:13 +01:00
arm_scpi.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
arm_sdei.c firmware: arm_sdei: Fix DT platform device creation 2019-12-05 09:21:02 +01:00
dcdbas.c platform/x86: Fix dell driver init order 2018-03-14 11:05:53 -07:00
dcdbas.h
dell_rbu.c firmware: dell_rbu: Make payload memory uncachable 2019-11-20 18:47:41 +01:00
dmi-id.c firmware: dmi: Add access to the SKU ID string 2018-06-17 14:09:42 +02:00
dmi-sysfs.c firmware: dmi: handle missing DMI data gracefully 2018-02-03 11:25:20 +01:00
dmi_scan.c firmware: dmi: Add access to the SKU ID string 2018-06-17 14:09:42 +02:00
edd.c edd: don't spam log if no EDD information is present 2018-03-27 09:51:23 +02:00
iscsi_ibft.c iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND 2019-08-16 10:12:45 +02:00
iscsi_ibft_find.c
Kconfig iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND 2019-08-16 10:12:45 +02:00
Makefile firmware: arm_scmi: add basic driver infrastructure for SCMI 2018-02-28 16:37:57 +00:00
memmap.c
pcdp.c x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap() for RAM mappings 2017-07-18 11:37:58 +02:00
pcdp.h
psci.c firmware/psci: Expose SMCCC version through psci_ops 2018-02-06 22:54:11 +00:00
psci_checker.c firmware/psci: psci_checker: Park kthreads before stopping them 2019-08-06 19:06:48 +02:00
qcom_scm-32.c firmware: qcom: scm: Fix crash in qcom_scm_call_atomic1() 2018-05-24 22:36:45 -05:00
qcom_scm-64.c firmware: qcom: scm: Ensure 'a0' status code is treated as signed 2019-12-17 20:35:42 +01:00
qcom_scm.c firmware: qcom_scm: Use proper types for dma mappings 2019-10-05 13:09:34 +02:00
qcom_scm.h remoteproc updates for v4.15 2017-11-17 20:14:10 -08:00
qemu_fw_cfg.c media: headers: fix linux/mod_devicetable.h inclusions 2018-08-02 18:30:54 -04:00
raspberrypi.c firmware: raspberrypi: Fix firmware calls with large buffers 2019-12-13 08:51:26 +01:00
scpi_pm_domain.c
ti_sci.c firmware: ti_sci: Always request response from firmware 2019-09-19 09:09:39 +02:00
ti_sci.h firmware: ti_sci: Switch to SPDX Licensing 2018-05-04 23:10:23 -07:00