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:
Pyun YongHyeon 2005-09-14 01:34:13 +00:00
parent 6f798df578
commit 005a5d42fa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150115

View File

@ -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);