Fix module unload panic which was caused by missing sx lock release.
While I'm here add KASSERT(9) to notify failure of SYSUNINIT handler. Reported by: Ben Kaduk < minimarmot AT gmail DOT com > Tested by: Ben Kaduk < minimarmot AT gmail DOT com >
This commit is contained in:
parent
6f798df578
commit
005a5d42fa
@ -368,6 +368,7 @@ sndstat_uninit(void)
|
||||
sndstat_dev = 0;
|
||||
|
||||
splx(s);
|
||||
sx_xunlock(&sndstat_lock);
|
||||
sx_destroy(&sndstat_lock);
|
||||
return 0;
|
||||
}
|
||||
@ -387,7 +388,10 @@ sndstat_sysinit(void *p)
|
||||
static void
|
||||
sndstat_sysuninit(void *p)
|
||||
{
|
||||
sndstat_uninit();
|
||||
int error;
|
||||
|
||||
error = sndstat_uninit();
|
||||
KASSERT(error == 0, ("%s: error = %d", __func__, error));
|
||||
}
|
||||
|
||||
SYSINIT(sndstat_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, sndstat_sysinit, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user