Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20a04433 authored by Chaitra P B's avatar Chaitra P B Committed by Martin K. Petersen
Browse files

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: default avatarChaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e3586147
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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.