cardbus: Be sure to acquire Giant when calling into newbus

Acquire Giant in cardbus_detach_card. This used to be done above us, but no
more.

Tested by: kargl@
MFC After: 3 days
This commit is contained in:
Warner Losh 2021-02-27 00:00:52 -07:00
parent c170aa9f37
commit c01da939b0

View File

@ -256,10 +256,11 @@ cardbus_detach_card(device_t cbdev)
{
int err = 0;
mtx_lock(&Giant);
err = bus_generic_detach(cbdev);
if (err)
return (err);
err = device_delete_children(cbdev);
if (err == 0)
err = device_delete_children(cbdev);
mtx_unlock(&Giant);
if (err)
return (err);