Skip to content

Commit

Permalink
[PATCH] Fix reference of uninitialised memory in ata_device_add()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Jones authored and Jeff Garzik committed Sep 27, 2006
1 parent bda3028 commit c38778c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c38778c

Please sign in to comment.