]> 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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 13 Oct 2021 02:08:23 +0000 (22:08 -0400)
commitf2b85040acec9a928b4eb1b57a989324e8e38d3f
tree1dab47ff0d111341e0e51737e94fe6fbc4072a6b
parent6fd13d699d24beaa28310848fe65fd898fbb9043
scsi: core: Put LLD module refcnt after SCSI device is released

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>
drivers/scsi/scsi.c
drivers/scsi/scsi_sysfs.c