alistair23-linux/drivers/firmware/arm_scmi
Wen Yang 8305e90a89 firmware: arm_scmi: Avoid double free in error flow
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>
2019-11-26 10:50:30 +00:00
..
base.c firmware: arm_scmi: Use {get,put}_unaligned_le{32,64} accessors 2019-08-12 12:23:01 +01:00
bus.c firmware: arm_scmi: Avoid double free in error flow 2019-11-26 10:50:30 +00:00
clock.c firmware: arm_scmi: Use {get,put}_unaligned_le{32,64} accessors 2019-08-12 12:23:01 +01:00
common.h firmware: arm_scmi: Use {get,put}_unaligned_le{32,64} accessors 2019-08-12 12:23:01 +01:00
driver.c firmware: arm_scmi: Add support for asynchronous commands and delayed response 2019-08-12 12:23:00 +01:00
Makefile firmware: arm_scmi: Add RESET protocol in SCMI v2.0 2019-08-12 12:23:02 +01:00
perf.c firmware: arm_scmi: Fix doorbell ring logic for !CONFIG_64BIT 2019-11-14 11:13:50 +00:00
power.c firmware: arm_scmi: Use {get,put}_unaligned_le{32,64} accessors 2019-08-12 12:23:01 +01:00
reset.c firmware: arm_scmi: reset: fix reset_state assignment in scmi_domain_reset 2019-09-18 13:42:16 +01:00
scmi_pm_domain.c firmware: arm_scmi: add device power domain support using genpd 2018-02-28 16:37:57 +00:00
sensors.c firmware: arm_scmi: Use {get,put}_unaligned_le{32,64} accessors 2019-08-12 12:23:01 +01:00