Skip to contentSkip to conversation

drivers/scsi/ibmmca.c: fix a NULL pointer dereference

PATCH New Adrian Bunk 1 participant 1 message Mar 10, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/scsi/ibmmca.c: fix a NULL pointer dereference

The variable was dereferenced only if it was NULL (sic)...

Spotted by the Coverity checker.

drivers/scsi/ibmmca.c renamed from drivers/scsi/ibmmca.c.old +1 -2
@@ -2357,8 +2357,7 @@ static int ibmmca_proc_info(struct Scsi_
 	spin_lock_irqsave(hosts[i]->host_lock, flags);	/* Check it */
 	host_index = i;
 	if (!shpnt) {
-		len += sprintf(buffer + len, "\nIBM MCA SCSI: Can't find adapter for host number %d\n",
-				shpnt->host_no);
+		len += sprintf(buffer + len, "\nIBM MCA SCSI: Can't find adapter");
 		return len;
 	}
 	max_pun = subsystem_maxid(host_index);