Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 46edb8d ("firmware: arm_scmi: provide the mandatory device release callback") Signed-off-by: Wen Yang <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
- Loading branch information