diff options
author | Mark Brown <broonie@kernel.org> | 2019-06-18 21:12:47 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-06-18 21:12:47 +0300 |
commit | e1d700f7c94e755106749411706a38e39a93404b (patch) | |
tree | b1230cb7eba5a4ef28ed2cd2527d9ac78f06cc00 /drivers/s390/scsi/zfcp_scsi.c | |
parent | ba576a6232dc06605f4edfaeea9b526ba7724f84 (diff) | |
parent | d1fdb6d8f6a4109a4263176c84b899076a5f8008 (diff) | |
download | linux-e1d700f7c94e755106749411706a38e39a93404b.tar.xz |
Merge tag 'v5.2-rc4' into regulator-5.3
Linux 5.2-rc4
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 221d0dfb8493..e9ded2befa0d 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -129,6 +129,15 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) zfcp_sdev->erp_action.port = port; + mutex_lock(&zfcp_sysfs_port_units_mutex); + if (zfcp_sysfs_port_is_removing(port)) { + /* port is already gone */ + mutex_unlock(&zfcp_sysfs_port_units_mutex); + put_device(&port->dev); /* undo zfcp_get_port_by_wwpn() */ + return -ENXIO; + } + mutex_unlock(&zfcp_sysfs_port_units_mutex); + unit = zfcp_unit_find(port, zfcp_scsi_dev_lun(sdev)); if (unit) put_device(&unit->dev); |