Subject: Re: [PATCH 3/7] CAN: Add raw protocol

From: Oliver Hartkopp <[email-masked]>
Date: Tue, 02 Oct 2007 16:53:04 +0200

Arnaldo Carvalho de Melo wrote:
> Em Tue, Oct 02, 2007 at 03:10:09PM +0200, Urs Thuermann escreveu:
>   
>
>> +
>> +		if (ro->bound && ro->ifindex)
>> +			dev = dev_get_by_index(&init_net, ro->ifindex);
>>     
>
> dev_get_by_index can fail, are you sure that raw_enable_filters can cope
> with this possibility?
>
>   

When dev_get_by_index() fails, the netdev is not there anymore.
In this case the netdev notifier handler already set ro->bound to 0.

Additionally raw_enable_filters() can handle *dev even when it's NULL.

Oliver