summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-09-27 08:52:50 +0200
committerJeff Garzik <jeff@garzik.org>2006-09-28 00:05:40 +0200
commitc38778c3a9aeadcd1ee319cfc8ea5a9cbf8cdafa (patch)
treea4655b566c867924c70c6a8d703b480f97f4c687 /drivers
parent[libata] Don't use old-EH ->eng_timeout() hook when not needed (diff)
downloadlinux-c38778c3a9aeadcd1ee319cfc8ea5a9cbf8cdafa.tar.xz
linux-c38778c3a9aeadcd1ee319cfc8ea5a9cbf8cdafa.zip
[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 <davej@redhat.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index b4abd6850367..396493cc98ce 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");