Skip to contentSkip to conversation

cosa.c intialization crash

PATCH New Jan Kasprzak 1 participant 2 messages Dec 2, 2004 – Jan 6, 2005 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cosa.c intialization crash

The attached patch fixes crash on insmod of the cosa.ko module
- the sppp_attach() was called too early when dev->priv has not been set up yet. Linus, please apply.

drivers/net/wan/cosa.c renamed from drivers/net/wan/cosa.c.orig +1 -1
@@ -642,11 +642,11 @@
 		return;
 	}
 	chan->pppdev.dev = d;
-	sppp_attach(&chan->pppdev);
 	d->base_addr = chan->cosa->datareg;
 	d->irq = chan->cosa->irq;
 	d->dma = chan->cosa->dma;
 	d->priv = chan;
+	sppp_attach(&chan->pppdev);
 	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(d);
Signature · 3 lines
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/   Czech Linux Homepage: http://www.linux.cz/ |
Quoted 2 lines

Whatever the Java applications and desktop dances may lead to, Unix will <
still be pushing the packets around for a quite a while. --Rob Pike <

#1 lore raw

PATCH 1/1 cosa.c intialization crash

Linus, please apply the attached patch (I am reposting this again).
Without this, the cosa driver crashes immediately during insmod.

Original mail:

The attached patch fixes crash on insmod of the cosa.ko module
- the sppp_attach() was called too early when dev->priv has not been set up yet. Linus, please apply.

drivers/net/wan/cosa.c renamed from drivers/net/wan/cosa.c.orig +1 -1
@@ -642,11 +642,11 @@
 		return;
 	}
 	chan->pppdev.dev = d;
-	sppp_attach(&chan->pppdev);
 	d->base_addr = chan->cosa->datareg;
 	d->irq = chan->cosa->irq;
 	d->dma = chan->cosa->dma;
 	d->priv = chan;
+	sppp_attach(&chan->pppdev);
 	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(d);
Signature · 3 lines
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/   Czech Linux Homepage: http://www.linux.cz/ |
Quoted 2 lines

Whatever the Java applications and desktop dances may lead to, Unix will <
still be pushing the packets around for a quite a while. --Rob Pike <