Skip to content

Commit

Permalink
pata_legacy: don't call ata_host_detach() after initialization failure
Browse files Browse the repository at this point in the history
ata_host_detach() detaches an attached port and shouldn't be called on
a port which hasn't been attached yet.  pata_legacy incorrectly calls
ata_host_detach() on unattached port after initialization failure
causing oops.  Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 15, 2008
1 parent 5ab063e commit 7a3a16f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/ata/pata_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,6 @@ static __init int legacy_init_one(struct legacy_probe *probe)
}
}
fail:
if (host)
ata_host_detach(host);
platform_device_unregister(pdev);
return ret;
}
Expand Down

0 comments on commit 7a3a16f

Please sign in to comment.