Page MenuHomeFreeBSD

dpaa2_mc: Check for error the first time bus_generic_detach is called
ClosedPublic

Authored by jhb on Nov 1 2024, 2:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 28, 2:14 PM
Unknown Object (File)
Nov 23 2024, 8:24 PM
Unknown Object (File)
Nov 20 2024, 10:39 PM
Unknown Object (File)
Nov 20 2024, 3:54 AM
Unknown Object (File)
Nov 17 2024, 8:47 PM
Unknown Object (File)
Nov 14 2024, 2:11 PM
Unknown Object (File)
Nov 14 2024, 1:00 PM
Unknown Object (File)
Nov 14 2024, 12:11 PM
Subscribers

Details

Summary

This removes the need for the second call.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Nov 1 2024, 2:21 PM
jhb created this revision.
sys/dev/dpaa2/dpaa2_mc.c
286

In case of an error returned by any device_detach() all of the de-allocation below will be skipped. I'd rather log this error instead.

sys/dev/dpaa2/dpaa2_mc.c
286

But you can't just keep going. device_delete_children() is going to fail as well if bus_generic_detach() fails. That means you will still be attached, but will have your state partially destroyed, and child drivers can still call into your driver that now has mostly destroyed state and probably cause a panic. You have to stop if child drivers fail to detach.

This revision is now accepted and ready to land.Nov 2 2024, 7:32 PM