]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: sg: add sg_remove_request in sg_write
authorWu Bo <wubo40@huawei.com>
Tue, 14 Apr 2020 02:13:28 +0000 (10:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:18:34 +0000 (08:18 +0200)
commit34fcb4291e234468f9bf9d4b851c9f522f3bbb13
tree7e231488065cceddf7a4bc3b148803e6fa025f8e
parent3c11fec8151972c93fba530fcdd752a40f794296
scsi: sg: add sg_remove_request in sg_write

commit 83c6f2390040f188cc25b270b4befeb5628c1aee upstream.

If the __copy_from_user function failed we need to call sg_remove_request
in sg_write.

Link: https://lore.kernel.org/r/610618d9-e983-fd56-ed0f-639428343af7@huawei.com
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Wu Bo <wubo40@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[groeck: Backport to v5.4.y and older kernels]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/sg.c