Skip to content

Commit 5b06a71

Browse files
Ranjan Kumarmartinkpetersen
authored andcommitted
scsi: mpi3mr: Driver unload crashes host when enhanced logging is enabled
Prevent driver from trying to dereference a NULL pointer in a debug print while removing a device during driver unload. Signed-off-by: Ranjan Kumar <[email protected]> Signed-off-by: Sreekanth Reddy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 02ca7da commit 5b06a71

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/scsi/mpi3mr/mpi3mr_transport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,8 @@ static void mpi3mr_sas_port_remove(struct mpi3mr_ioc *mrioc, u64 sas_address,
15521552

15531553
list_for_each_entry_safe(mr_sas_phy, next_phy,
15541554
&mr_sas_port->phy_list, port_siblings) {
1555-
if ((mrioc->logging_level & MPI3_DEBUG_TRANSPORT_INFO))
1555+
if ((!mrioc->stop_drv_processing) &&
1556+
(mrioc->logging_level & MPI3_DEBUG_TRANSPORT_INFO))
15561557
dev_info(&mr_sas_port->port->dev,
15571558
"remove: sas_address(0x%016llx), phy(%d)\n",
15581559
(unsigned long long)

0 commit comments

Comments
 (0)