From: Dave Jones Date: Wed, 27 Sep 2006 06:52:50 +0000 (-0700) Subject: [PATCH] Fix reference of uninitialised memory in ata_device_add() X-Git-Tag: v2.6.19-rc1~39^2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c38778c3a9aeadcd1ee319cfc8ea5a9cbf8cdafa;p=linux-2.6 [PATCH] Fix reference of uninitialised memory in ata_device_add() ata_device_add fails, calls ata_host_remove with pointers to unitialized memory. Signed-off-by: Dave Jones Cc: Jeff Garzik Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index b4abd68503..396493cc98 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5478,11 +5478,10 @@ int ata_device_add(const struct ata_probe_ent *ent) int irq_line = ent->irq; ap = ata_port_add(ent, host, i); + host->ports[i] = ap; if (!ap) goto err_out; - host->ports[i] = ap; - /* dummy? */ if (ent->dummy_port_mask & (1 << i)) { ata_port_printk(ap, KERN_INFO, "DUMMY\n");