Skip to contentSkip to conversation

sym53c8xx: fix NULL deref on error path

PATCH New Tony Battersby 1 participant 1 message Jan 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/7 sym53c8xx: fix NULL deref on error path

If sym_attach() fails to allocate np, the error path will dereference a NULL pointer for printk.

---

drivers/scsi/sym53c8xx_2/sym_glue.c renamed from drivers/scsi/sym53c8xx_2/sym_glue.c.orig +1 -1
@@ -1418,7 +1418,7 @@ static struct Scsi_Host * __devinit sym_
  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);