提交 31c60855 编写于 作者: D Dan Carpenter 提交者: Sudeep Holla

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: 907b6d14 ("firmware: arm_scmi: add per-protocol channels support using idr objects")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
上级 60cc43fc
...@@ -778,6 +778,7 @@ scmi_create_protocol_device(struct device_node *np, struct scmi_info *info, ...@@ -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)) { if (scmi_mbox_chan_setup(info, &sdev->dev, prot_id)) {
dev_err(&sdev->dev, "failed to setup transport\n"); dev_err(&sdev->dev, "failed to setup transport\n");
scmi_device_destroy(sdev); scmi_device_destroy(sdev);
return;
} }
/* setup handle now as the transport is ready */ /* setup handle now as the transport is ready */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册