]> git.itanic.dy.fi Git - linux-stable/commit
scsi: Revert "scsi: core: Do not increase scsi_device's iorequest_cnt if dispatch...
authorWenchao Hao <haowenchao2@huawei.com>
Mon, 15 May 2023 07:01:55 +0000 (15:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:30:24 +0000 (17:30 +0100)
commit35fe6fa57b994e7da222893adf0bb748d6055e73
treead3922ee5b4f4310f8b5e1edc2e1e643c037edeb
parent71355fa31e2081ce78e11f590189dfe630ddb40d
scsi: Revert "scsi: core: Do not increase scsi_device's iorequest_cnt if dispatch failed"

commit 6ca9818d1624e136a76ae8faedb6b6c95ca66903 upstream.

The "atomic_inc(&cmd->device->iorequest_cnt)" in scsi_queue_rq() would
cause kernel panic because cmd->device may be freed after returning from
scsi_dispatch_cmd().

This reverts commit cfee29ffb45b1c9798011b19d454637d1b0fe87d.

Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
Reported-by: Ming Lei <ming.lei@redhat.com>
Closes: https://lore.kernel.org/r/ZF+zB+bB7iqe0wGd@ovpn-8-17.pek2.redhat.com
Link: https://lore.kernel.org/r/20230515070156.1790181-2-haowenchao2@huawei.com
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/scsi_lib.c