Do not handle MOD_SHUTDOWN equally to MOD_UNLOAD in sound kernel module.

MOD_SHUTDOWN is not an end of existence, and there is a life after it.
In particular, code previously called on MOD_SHUTDOWN grabbed lock and
deallocated unit numbering. That caused infinite wait loop if snd_uaudio
tried to destroy its PCM device after that point.

MFC after:	3 days
This commit is contained in:
Alexander Motin 2012-02-14 09:19:30 +00:00
parent 9697f9f801
commit 5525b53de5

View File

@ -1415,7 +1415,6 @@ sound_modevent(module_t mod, int type, void *data)
pcmsg_unrhdr = new_unrhdr(1, INT_MAX, NULL);
break;
case MOD_UNLOAD:
case MOD_SHUTDOWN:
ret = sndstat_acquire(curthread);
if (ret != 0)
break;
@ -1424,6 +1423,8 @@ sound_modevent(module_t mod, int type, void *data)
pcmsg_unrhdr = NULL;
}
break;
case MOD_SHUTDOWN:
break;
default:
ret = ENOTSUP;
}