linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: Use after free in scmi_create_protocol_device()
@ 2018-04-27 14:06 Dan Carpenter
  2018-04-27 14:47 ` Sudeep Holla
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-04-27 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

We need to return here instead of setting up the freed sdev device as a
transport.

Fixes: 907b6d14911d ("firmware: arm_scmi: add per-protocol channels support using idr objects")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 14b147135a0c..2455be8cbc4f 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -778,6 +778,7 @@ scmi_create_protocol_device(struct device_node *np, struct scmi_info *info,
 	if (scmi_mbox_chan_setup(info, &sdev->dev, prot_id)) {
 		dev_err(&sdev->dev, "failed to setup transport\n");
 		scmi_device_destroy(sdev);
+		return;
 	}
 
 	/* setup handle now as the transport is ready */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] firmware: arm_scmi: Use after free in scmi_create_protocol_device()
  2018-04-27 14:06 [PATCH] firmware: arm_scmi: Use after free in scmi_create_protocol_device() Dan Carpenter
@ 2018-04-27 14:47 ` Sudeep Holla
  0 siblings, 0 replies; 2+ messages in thread
From: Sudeep Holla @ 2018-04-27 14:47 UTC (permalink / raw)
  To: linux-arm-kernel



On 27/04/18 15:06, Dan Carpenter wrote:
> We need to return here instead of setting up the freed sdev device as a
> transport.
> 
> Fixes: 907b6d14911d ("firmware: arm_scmi: add per-protocol channels support using idr objects")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks for the fix, will send to ARM-SoC in the next round.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-27 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-27 14:06 [PATCH] firmware: arm_scmi: Use after free in scmi_create_protocol_device() Dan Carpenter
2018-04-27 14:47 ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).