Hello!
> unregister_netdevice: Old style device vlan0004 leaked(refcnt=1). Wait for
> crash.
> (I especially like the last part!!)
It does not lie. If that guy who holds refcnt will remember about this
device finally, it will be oops in the best case or even memory corruption.
If you allocate device struct via kmalloc(), it is better to convert
it to "new style". F.e. look into tunnels or to ppp.
> Is this problem something that my code could be responsible for,
> or is it something else in the stack?
It can be everywhere, where the device is referenced. Debug!
> I memset the net_device struct to zero before I start filling it in,
> so the refcnt starts out as zero. I never actively (that I know of)
> mess with the refcnt one way or another...
It is correct.
> What kinds of things (calls?) affect the refcnt?
Any place, which gets this device to use it later.
skbs, routes, arp entries etc. etc.
Where is the code? Probably, I will be able to see hole.
Alexey Kuznetsov
|