提交 a1ee1c08 编写于 作者: C Chengfeng Ye 提交者: Sebastian Reichel

HSI: core: Fix return freed object in hsi_new_client

cl is freed on error of calling device_register, but this
object is return later, which will cause uaf issue. Fix it
by return NULL on error.
Signed-off-by: NChengfeng Ye <cyeaa@connect.ust.hk>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
上级 fa55b7dc
......@@ -102,6 +102,7 @@ struct hsi_client *hsi_new_client(struct hsi_port *port,
if (device_register(&cl->device) < 0) {
pr_err("hsi: failed to register client: %s\n", info->name);
put_device(&cl->device);
goto err;
}
return cl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册