aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanjan Kumar <[email protected]>2023-02-28 06:08:31 -0800
committerMartin K. Petersen <[email protected]>2023-03-06 18:33:12 -0500
commit5b06a7169c59ce0c77ef8b9c82aa07c478f82aac (patch)
treea040b4ac2ca7adc76dfd1d02e774bccef88a9e50
parent02ca7da2919ada525fb424640205110e24646b50 (diff)
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]>
-rw-r--r--drivers/scsi/mpi3mr/mpi3mr_transport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
index 3b61815979da..b795a325534d 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
@@ -1552,7 +1552,8 @@ static void mpi3mr_sas_port_remove(struct mpi3mr_ioc *mrioc, u64 sas_address,
list_for_each_entry_safe(mr_sas_phy, next_phy,
&mr_sas_port->phy_list, port_siblings) {
- if ((mrioc->logging_level & MPI3_DEBUG_TRANSPORT_INFO))
+ if ((!mrioc->stop_drv_processing) &&
+ (mrioc->logging_level & MPI3_DEBUG_TRANSPORT_INFO))
dev_info(&mr_sas_port->port->dev,
"remove: sas_address(0x%016llx), phy(%d)\n",
(unsigned long long)