Skip to content

Commit

Permalink
pata_legacy: fix no device fail path
Browse files Browse the repository at this point in the history
When pata_legacy can't detect any device, it unregisters the
platform_device and fails detection.  However, it forgets to detach
ata host triggering weird failures as the host later gets freed by
devres while still attached.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 16, 2009
1 parent 265b721 commit 20cbf5f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/ata/pata_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
return 0;
}
}
ata_host_detach(host);
fail:
platform_device_unregister(pdev);
return ret;
Expand Down

0 comments on commit 20cbf5f

Please sign in to comment.