Skip to content
Commit d85fc67d authored by Gwendal Grignou's avatar Gwendal Grignou Committed by Tejun Heo
Browse files

libata: transport: Remove circular dependency at free time



Without this patch, failed probe would not free resources like irq.

ata port tdev object currently hold a reference to the ata port
object.  Therefore the ata port object release function will not get
called until the ata_tport_release is called. But that would never
happen, releasing the last reference of ata port dev is done by
scsi_host_release, which is called by ata_host_release when the ata
port object is released.

The ata device objects actually do not need to explicitly hold a
reference to their real counterpart, given the transport objects are
the children of these objects and device_add() is call for each child.
We know the parent will not be deleted until we call the child's
device_del().

Reported-by: default avatarMatthew Whitehead <tedheadster@gmail.com>
Tested-by: default avatarMatthew Whitehead <tedheadster@gmail.com>
Suggested-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarGwendal Grignou <gwendal@chromium.org>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent c1ae3cfa
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment