Page MenuHomeFreeBSD

iwm: fix incorrect mutex / crash use during error detach path
ClosedPublic

Authored by adrian on Sat, Oct 17, 8:12 PM.
Referenced Files
F176411042: D60821.diff
Sun, Oct 18, 5:21 PM
F176394718: D60821.id190151.diff
Sun, Oct 18, 1:04 PM
F176390983: D60821.id190144.diff
Sun, Oct 18, 12:13 PM
Unknown Object (File)
Sun, Oct 18, 4:29 AM
Unknown Object (File)
Sun, Oct 18, 4:29 AM
Unknown Object (File)
Sun, Oct 18, 2:07 AM
Unknown Object (File)
Sun, Oct 18, 2:07 AM
Unknown Object (File)
Sun, Oct 18, 2:06 AM
Subscribers

Details

Summary

My previous commit (b3ef4013a4) added a couple of lock assertions.
However, the detach assertion is wrong - if the driver hasn't
attached then detach needs to be a no-op and this includes
not touching a deinit'ed mutex.

So, move the mutex check and use until after the attached check.

This fixes the driver crash I saw when another bit of in-flight
work caused attach to fail, and thus iwm_detach() -> iwm_detach_local()
ended up trying to use a deinit'ed mutex, leading to a crash.

Fixes: b3ef4013a4fa75063930d0221a0bc50f95af0527

Diff Detail

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

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Sat, Oct 17, 9:38 PM
This revision was automatically updated to reflect the committed changes.