scsi: iscsi: Fix inappropriate use of put_device()
stable inclusion from stable-5.10.4 commit dcda662622b17adaec14a1a6d82bf09e87b9ce11 bugzilla: 46903 -------------------------------- [ Upstream commit 6dc1c7ab ] kfree(conn) is called inside put_device(&conn->dev) which could lead to use-after-free. In addition, device_unregister() should be used here rather than put_deviceO(). Link: https://lore.kernel.org/r/20201120074852.31658-1-miaoqinglang@huawei.com Fixes: f3c893e3 ("scsi: iscsi: Fail session and connection on transport registration failure") Reported-by: NHulk Robot <hulkci@huawei.com> Reviewed-by: NMike Christie <michael.christie@oracle.com> Signed-off-by: NQinglang Miao <miaoqinglang@huawei.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Showing
想要评论请 注册 或 登录