Q: why calling kobject_put() twice?

From: Cong Wang <hidden>
Date: 2014-02-11 22:24:08

Hi,


There are many drivers either using free_netdev() as ->destructor() or
calling it in their own destructor(), and in free_netdev() we call
put_device(&dev->dev) at last. But in netdev_run_todo(), we call
kobject_put(&dev->dev.kobj) again after calling ->destructor(). So,
what's the point of doing this?

Also, if free_netdev() is supposed to free the netdev as its name
tells, then why it's still safe to read some field of it after that?

I must miss something here.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help