Skip to content

Commit

Permalink
[SCSI] ibmmca: fix a NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Bunk authored and James Bottomley committed Mar 12, 2006
1 parent c3c026b commit a6becb0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/ibmmca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a6becb0

Please sign in to comment.