Oh. Speaking of. One way to catch this kind of thing during debugging
is to instrument dev_put and dev_hold to add a print statement. Something
like:
/**
* dev_put - release reference to device
* @dev: network device
*
* Release reference to device to allow it to be freed.
*/
static inline void __dev_put(struct net_device *dev, char *file, char *func, int line)
{
if (dev->flags & IFF_LOOPBACK)
printk("%s: %s.%s.%d\n", __func__, file, file, line);
atomic_dec(&dev->refcnt);
}
#define dev_put(DEV) __dev_put(DEV, __FILE__, __func__, __LINE__)
/**
* dev_hold - get reference to device
* @dev: network device
*
* Hold reference to device to keep it from being freed.
*/
static inline void __dev_hold(struct net_device *dev, char *file, char *func, int line)
{
if (dev->flags & IFF_LOOPBACK)
printk("%s: %s.%s.%d\n", __func__, file, file, line);
atomic_inc(&dev->refcnt);
}
#define dev_hold(DEV) __dev_hold(DEV, __FILE__, __func__, __LINE__)
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html