]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: core: Put LLD module refcnt after SCSI device is released
authorMing Lei <ming.lei@redhat.com>
Fri, 8 Oct 2021 05:01:18 +0000 (13:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Nov 2021 12:59:44 +0000 (13:59 +0100)
commit4975d05cae3dec8a6019a8e882d81f9331dc294c
tree67bb9a83f6e5541d4c7cfe225f89b80f69ffa6f6
parentbb6d4b369540e9093417b7c847b31ffad9a2146d
scsi: core: Put LLD module refcnt after SCSI device is released

commit f2b85040acec9a928b4eb1b57a989324e8e38d3f upstream.

SCSI host release is triggered when SCSI device is freed. We have to make
sure that the low-level device driver module won't be unloaded before SCSI
host instance is released because shost->hostt is required in the release
handler.

Make sure to put LLD module refcnt after SCSI device is released.

Fixes a kernel panic of 'BUG: unable to handle page fault for address'
reported by Changhui and Yi.

Link: https://lore.kernel.org/r/20211008050118.1440686-1-ming.lei@redhat.com
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reported-by: Changhui Zhong <czhong@redhat.com>
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-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.c
drivers/scsi/scsi_sysfs.c