[SCSI] sym53c8xx: fix NULL deref on error path
authorTony Battersby <tonyb@cybernetics.com>
Thu, 8 Jan 2009 17:53:37 +0000 (12:53 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 12 Mar 2009 17:58:15 +0000 (12:58 -0500)
If sym_attach() fails to allocate np, the error path will dereference
a NULL pointer for printk.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/sym53c8xx_2/sym_glue.c

index ff5be95..cef03e7 100644 (file)
@@ -1418,7 +1418,7 @@ static struct Scsi_Host * __devinit sym_attach(struct scsi_host_template *tpnt,
  attach_failed:
        if (!shost)
                return NULL;
-       printf_info("%s: giving up ...\n", sym_name(np));
+       printf_info("sym%d: giving up ...\n", unit);
        if (np)
                sym_free_resources(np, pdev);
        scsi_host_put(shost);