if (dev->priv){ kfree(dev->priv); dev->priv=NULL; } 
kfree(dev->priv); dev->priv=NULL; 
static int wanrouter_delete_interface(struct wan_device *wandev, char *name){	struct net_device *dev = NULL, *prev = NULL;	unsigned long smp_flags=0;	lock_adapter_irq(&wandev->lock, &smp_flags);	dev = wandev->dev;	prev = NULL;	while (dev && strcmp(name, dev->name)) {		struct net_device **slave = dev->priv;		prev = dev;		dev = *slave;	}	unlock_adapter_irq(&wandev->lock, &smp_flags);	if (dev == NULL)		return -ENODEV;	/* interface not found */	if (netif_running(dev))		return -EBUSY;	/* interface in use */	if (wandev->del_if)		wandev->del_if(wandev, dev);	lock_adapter_irq(&wandev->lock, &smp_flags);	if (prev) {		struct net_device **prev_slave = prev->priv;		struct net_device **slave = dev->priv;		*prev_slave = *slave;	} else {		struct net_device **slave = dev->priv;		wandev->dev = *slave;	}	--wandev->ndev;	unlock_adapter_irq(&wandev->lock, &smp_flags);	printk(KERN_INFO "%s: unregistering '%s'\n", wandev->name, dev->name);	/* Due to new interface linking method using dev->priv,	 * this code has moved from del_if() function.*/	if (dev->priv){		kfree(dev->priv);		dev->priv=NULL;	}	unregister_netdev(dev);	free_netdev(dev);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a51482bde22f99c63fbbb57d5d46cc666384e379/wanmain.c/buggy/net/wanrouter/wanmain.c