From: Tejun Heo Date: Wed, 13 Feb 2008 09:20:19 +0000 (+0900) Subject: pata_legacy: don't call ata_host_detach() after initialization failure X-Git-Tag: Ubuntu-5.10.0-12.13~41098^2~7 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=7a3a16fe7ddf0570e2fcf286d7e244a5e1e16f6a;p=mirror_ubuntu-hirsute-kernel.git pata_legacy: don't call ata_host_detach() after initialization failure 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 Cc: Alan Cox Cc: Ingo Molnar Cc: Arjan van de Ven Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 6c59969fd50b..d2177f75078a 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c @@ -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; }