[PATCH] cosa.c intialization crash

From: Jan Kasprzak
Date: Thu Dec 02 2004 - 07:41:48 EST


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.

Signed-off-by: Jan "Yenya" Kasprzak <kas@xxxxxxxxxx>

--- linux-2.6.10-rc2/drivers/net/wan/cosa.c.orig 2004-12-02 13:33:00.650293092 +0100
+++ linux-2.6.10-rc2/drivers/net/wan/cosa.c 2004-11-15 02:26:39.000000000 +0100
@@ -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);
--
| 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/ |
> 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 <
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/