[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAHA+R7NMp_cvVCVhaYk--Yh=0KrEE-TKZXfk1MFGjWymC8dzLQ@mail.gmail.com>
Date: Tue, 11 Feb 2014 14:24:06 -0800
From: Cong Wang <cwang@...pensource.com>
To: netdev <netdev@...r.kernel.org>
Cc: David Miller <davem@...emloft.net>
Subject: Q: why calling kobject_put() twice?
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists