Commit d85fc67
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: Matthew Whitehead <[email protected]>
Tested-by: Matthew Whitehead <[email protected]>
Suggested-by: Tejun Heo <[email protected]>
Signed-off-by: Gwendal Grignou <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent c1ae3cf commit d85fc67
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
| |||
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | | - | |
| 286 | + | |
288 | 287 | | |
289 | 288 | | |
290 | 289 | | |
| |||
348 | 347 | | |
349 | 348 | | |
350 | 349 | | |
351 | | - | |
352 | 350 | | |
353 | 351 | | |
354 | 352 | | |
| |||
410 | 408 | | |
411 | 409 | | |
412 | 410 | | |
413 | | - | |
| 411 | + | |
414 | 412 | | |
415 | 413 | | |
416 | 414 | | |
| |||
589 | 587 | | |
590 | 588 | | |
591 | 589 | | |
592 | | - | |
593 | 590 | | |
594 | 591 | | |
595 | 592 | | |
| |||
662 | 659 | | |
663 | 660 | | |
664 | 661 | | |
665 | | - | |
| 662 | + | |
666 | 663 | | |
667 | 664 | | |
668 | 665 | | |
| |||
0 commit comments