Skip to contentSkip to conversation

firmware: arm_scmi: Use after free in scmi_create_protocol_device()

PATCH In review Dan Carpenter 2 participants 2 messages Apr 27, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: arm_scmi: Use after free in scmi_create_protocol_device()

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")
drivers/firmware/arm_scmi/driver.c +1 -0
index 14b147135a0c..2455be8cbc4f 100644
@@ -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 */
#1 lore raw
Quoted 5 lines · Dan Carpenter

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")

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

Signature · 2 lines
Regards,
Sudeep