mirror of
https://github.com/torvalds/linux.git
synced 2026-10-13 22:01:02 +02:00
firmware: arm_scmi: Free transport channel on IDR failure
If transport channel setup succeeds but the following IDR insertion fails,
the error path destroys the transport device and frees the channel info
without invoking the transport cleanup callback.
Call chan_free() before destroying the device so transport specific
resources such as IRQs, mailbox channels and mapped shared memory are
released consistently with the normal teardown path.
Fixes: 05a2801d8b ("firmware: arm_scmi: Use dedicated devices to initialize channels")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://patch.msgid.link/20260714-scmi_core_fixes-v6-5-3afe499d46e3@kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
This commit is contained in:
parent
687d67be3d
commit
d72e7e5f24
|
|
@ -2808,6 +2808,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device_node *of_node,
|
|||
"unable to allocate SCMI idr slot err %d\n", ret);
|
||||
/* Destroy channel and device only if created by this call. */
|
||||
if (tdev) {
|
||||
info->desc->ops->chan_free(prot_id, cinfo, idr);
|
||||
of_node_put(of_node);
|
||||
scmi_device_destroy(info->dev, prot_id, name);
|
||||
devm_kfree(info->dev, cinfo);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user