summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_sysfs.c
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2021-11-03 21:46:00 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2021-11-03 21:46:00 -0400
commit6266f7df38e167a2386ee2747965c4816f32b449 (patch)
treeff3d243efd8c374d2c9686de4a104da71218a952 /drivers/scsi/scsi_sysfs.c
parent5ae17501bc62a49b0b193dcce003f16375f16654 (diff)
parent09d9e4d041876684d33f21d02bcdaea6586734f1 (diff)
downloadlinux-stable-6266f7df38e167a2386ee2747965c4816f32b449.tar.gz
linux-stable-6266f7df38e167a2386ee2747965c4816f32b449.tar.bz2
linux-stable-6266f7df38e167a2386ee2747965c4816f32b449.zip
Merge branch '5.15/scsi-fixes' into 5.16/scsi-queue
The partial UFS revert in 5.15 is needed for some additional fixes in the 5.16 SCSI tree. Merge the fixes branch. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r--drivers/scsi/scsi_sysfs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index f06639d21e11..55addd78fde4 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -444,9 +444,12 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
struct scsi_vpd *vpd_pg80 = NULL, *vpd_pg83 = NULL;
struct scsi_vpd *vpd_pg0 = NULL, *vpd_pg89 = NULL;
unsigned long flags;
+ struct module *mod;
sdev = container_of(work, struct scsi_device, ew.work);
+ mod = sdev->host->hostt->module;
+
scsi_dh_release_device(sdev);
parent = sdev->sdev_gendev.parent;
@@ -497,11 +500,17 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
if (parent)
put_device(parent);
+ module_put(mod);
}
static void scsi_device_dev_release(struct device *dev)
{
struct scsi_device *sdp = to_scsi_device(dev);
+
+ /* Set module pointer as NULL in case of module unloading */
+ if (!try_module_get(sdp->host->hostt->module))
+ sdp->host->hostt->module = NULL;
+
execute_in_process_context(scsi_device_dev_release_usercontext,
&sdp->ew);
}