[SCSI] ibmmca: fix a NULL pointer dereference
authorAdrian Bunk <bunk@stusta.de>
Fri, 10 Mar 2006 22:24:47 +0000 (23:24 +0100)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sun, 12 Mar 2006 15:46:11 +0000 (09:46 -0600)
The variable was dereferenced only if it was NULL (sic)...

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/ibmmca.c

index b60c1b9270f171358de32efc071b96c4c001d9e8..3a8462e8d06354e390de6921df07190fbaa4ce61 100644 (file)
@@ -2412,8 +2412,7 @@ static int ibmmca_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start,
        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);