public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] scsi: smartpqi: use shost_to_hba() in pqi_scan_finished()
       [not found] <20260421202018.511388-1-mwilck@suse.com>
@ 2026-04-21 20:20 ` Martin Wilck
  0 siblings, 0 replies; only message in thread
From: Martin Wilck @ 2026-04-21 20:20 UTC (permalink / raw)
  To: Martin K. Petersen, Christoph Hellwig, Don Brace
  Cc: linux-scsi, Hannes Reinecke, Lee Duncan, Martin Wilck, storagedev,
	stable

shost_to_hba() is used everywhere except to obtain pqi_ctrl_info
from shosti, except in pqi_scan_finished(), where shost_priv() is used.
This causes one pointer dereference to be missed, as shost->hostdata
is a pointer in smartpqi. Fix it.

Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi smartpqi driver")
Signed-off-by: Martin Wilck <mwilck@suse.com>
Cc: Don Brace <don.brace@microchip.com>
Cc: storagedev@microchip.com
Cc: stable@vger.kernel.org
Reviewed-by: Don Brace <don.brace@microchip.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>

---
 drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index b4ed991976d0..65ff50982978 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2642,7 +2642,7 @@ static int pqi_scan_finished(struct Scsi_Host *shost,
 {
 	struct pqi_ctrl_info *ctrl_info;
 
-	ctrl_info = shost_priv(shost);
+	ctrl_info = shost_to_hba(shost);
 
 	return !mutex_is_locked(&ctrl_info->scan_mutex);
 }
-- 
2.53.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-21 20:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260421202018.511388-1-mwilck@suse.com>
2026-04-21 20:20 ` [PATCH v2 1/2] scsi: smartpqi: use shost_to_hba() in pqi_scan_finished() Martin Wilck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox