Very clear explanation,thank you! :-)

Zhangjie

-----Original Message-----
From: Eric Dumazet [mailto:eric.duma...@gmail.com] 
Sent: Wednesday, August 26, 2015 9:10 PM
To: Zhangjie (HZ)
Cc: Jason Wang; netdev@vger.kernel.org; Qinchuanyu; Yewudi; liuyongan 00175866; 
Wangbicheng; Yan Chen
Subject: Re: [Question] Usage of dev_hold()/dev_put()

On Wed, 2015-08-26 at 07:48 +0000, Zhangjie (HZ) wrote:
> Eric,
> Thank you for your patient apply.
> There is still a question, 
> In receive path, driver does not call dev_hold(), when skb goes to host 
> stack, skb->dev is likely to be used. 
> If device is destroyed before that, it seems dangerous.

This is also handled properly.

Check : flush_backlog() in net/core/dev.c
   sock_queue_rcv_skb() , and all functions setting skb->dev to NULL


Reply via email to