PATCH sound module removal oops fixed.

Daniel Kobras (belbo@zxmtj03.extern.uni-tuebingen.de)
Tue, 26 May 1998 00:52:37 +0200 (CEST)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--8323328-433373153-896136757=:1469
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi Alan.

In 2.1.103 and probably since the late 90s, removing the Soundblaster
module produced a kernel oops. I tracked down unload_uart401() in
uart401.c to be the culprit:

*** from uart401.c ***

sound_unload_mididev(hw_config->slots[4]);
if (devc)
{
kfree(midi_devs[devc->my_dev]->converter);
kfree(midi_devs[devc->my_dev]);

*** end ***

Actually I'm not aware of the difference between hw_config->slots[4] and
devc->my_dev (usually both are 0). However in sound_unload_mididev()
midi_devs[hw_config->slots[4]] is set to NULL, so the following
midi_devs[devc->my_dev]->converter inevitably produces a NULL pointer
dereference oops. The attached patch should fix the problem. I'm not sure
if it's the best way to work around but it certainly works for me. Please
try to get it into 2.1.104 if possible since the oops will leave the
modutils in a rather wrecked state, i.e. kernel autoloading will still
work but any manual modprobe/insmod/rmmod call just fails.

Regards,

Daniel.

--8323328-433373153-896136757=:1469
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=uart_patch
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.980526005237.1469B@abulafia>
Content-Description:

LS0tIGRyaXZlcnMvc291bmQvdWFydDQwMS5jLm9yaWcJTW9uIE1heSAyNSAy
MzoyMzo1MiAxOTk4DQorKysgZHJpdmVycy9zb3VuZC91YXJ0NDAxLmMJTW9u
IE1heSAyNSAyMzoxNjoxMiAxOTk4DQpAQCAtNDE2LDExICs0MTYsMTIgQEAN
CiB7DQogCXVhcnQ0MDFfZGV2YyAqZGV2YzsNCiAJaW50IG49aHdfY29uZmln
LT5zbG90c1s0XTsNCi0JDQorCXN0cnVjdCBtaWRpX29wZXJhdGlvbnMgKm15
X21pZGlfZGV2Ow0KKw0KIAkvKiBOb3Qgc2V0IHVwICovDQogCWlmKG49PS0x
IHx8IG1pZGlfZGV2c1tuXT09TlVMTCkNCiAJCXJldHVybjsNCi0JCQ0KKwkN
CiAJLyogTm90IGFsbG9jYXRlZCAoZXJtID8/KSAqLw0KIAkNCiAJZGV2YyA9
IG1pZGlfZGV2c1tod19jb25maWctPnNsb3RzWzRdXS0+ZGV2YzsNCkBAIC00
MzIsMTEgKzQzMywxNSBAQA0KIA0KIAlpZiAoIWRldmMtPnNoYXJlX2lycSkN
CiAJCWZyZWVfaXJxKGRldmMtPmlycSwgZGV2Yyk7DQorDQorCW15X21pZGlf
ZGV2ID0gbWlkaV9kZXZzW2RldmMtPm15X2Rldl07DQorCQ0KIAlzb3VuZF91
bmxvYWRfbWlkaWRldihod19jb25maWctPnNsb3RzWzRdKTsNCisNCiAJaWYg
KGRldmMpDQogCXsNCi0JCWtmcmVlKG1pZGlfZGV2c1tkZXZjLT5teV9kZXZd
LT5jb252ZXJ0ZXIpOw0KLQkJa2ZyZWUobWlkaV9kZXZzW2RldmMtPm15X2Rl
dl0pOw0KKwkJa2ZyZWUobXlfbWlkaV9kZXYtPmNvbnZlcnRlcik7DQorCQlr
ZnJlZShteV9taWRpX2Rldik7DQogCQlrZnJlZShkZXZjKTsNCiAJCWRldmMg
PSBOVUxMOw0KIAl9DQo=
--8323328-433373153-896136757=:1469--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu