diff options
author | Chaitra P B <chaitra.basappa@broadcom.com> | 2018-05-31 12:34:49 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-06-19 03:05:32 +0200 |
commit | 20a044332dc47e91045670311f9f9dcb1e32483f (patch) | |
tree | b9ead1a38868408fdf621446d03ba4e3fd1130e1 /drivers/scsi/mpt3sas | |
parent | scsi: mpt3sas: Incorrect command status was set/marked as not used. (diff) | |
download | linux-20a044332dc47e91045670311f9f9dcb1e32483f.tar.xz linux-20a044332dc47e91045670311f9f9dcb1e32483f.zip |
scsi: mpt3sas: Don't access the structure after decrementing it's instance reference count.
While configuring of NVMe device handling, _pcie_device structure member
was accessed after its reference count is decremented/put. Hence modified
code to access member of _pcie_device structure before its reference count
is decremented/put.
Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpt3sas')
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_scsih.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 884878b2113d..bf578271a844 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -2365,13 +2365,14 @@ scsih_slave_configure(struct scsi_device *sdev) "connector name( %s)\n", ds, pcie_device->enclosure_level, pcie_device->connector_name); - pcie_device_put(pcie_device); - spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); - scsih_change_queue_depth(sdev, qdepth); if (pcie_device->nvme_mdts) blk_queue_max_hw_sectors(sdev->request_queue, pcie_device->nvme_mdts/512); + + pcie_device_put(pcie_device); + spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); + scsih_change_queue_depth(sdev, qdepth); /* Enable QUEUE_FLAG_NOMERGES flag, so that IOs won't be ** merged and can eliminate holes created during merging ** operation. |