Skip to contentSkip to conversation

[2.4/2.5] Fix ns83820 ioctl oops

PATCH New Roger Luethi 1 participant 1 message Nov 26, 2002 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 [2.4/2.5] Fix ns83820 ioctl oops

Patch fixes the line mistaking a null pointer for an actual reference. Also, to prevent this from happening again, the null pointer now is replaced with the real one. Please apply.

Roger

net/ns83820.c renamed from net/ns83820.c.orig +2 -1
@@ -1214,7 +1214,7 @@ static int ns83820_ethtool_ioctl (struct
 
 static int ns83820_ioctl(struct net_device *_dev, struct ifreq *rq, int cmd)
 {
-	struct ns83820 *dev = _dev->priv;
+	struct ns83820 *dev = (struct ns83820 *)_dev;
 
 	switch(cmd) {
 	case SIOCETHTOOL:
@@ -1788,6 +1788,7 @@ static int __devinit ns83820_init_one(st
 	dev->ee.cache = &dev->MEAR_cache;
 	dev->ee.lock = &dev->misc_lock;
 	dev->net_dev.owner = THIS_MODULE;
+	dev->net_dev.priv = dev;
 
 	PREPARE_TQUEUE(&dev->tq_refill, queue_refill, dev);
 	tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)dev);