Subject: Re: [PATCH net] net: Fix the rollback test in dev_change_name()

From: Eric Dumazet <[email-masked]>
Date: Mon, 16 Nov 2009 12:08:22 +0100

David Miller a écrit :
> From: Jarek Poplawski <[email-masked]>
> Date: Mon, 16 Nov 2009 09:30:24 +0000
> 
>> From: Eric Dumazet <[email-masked]>
>>
>> net: Fix the rollback test in dev_change_name()
>>
>> In dev_change_name() an err variable is used for storing the original
>> call_netdevice_notifiers() errno (negative) and testing for a rollback
>> error later, but the test for non-zero is wrong, because the err might
>> have positive value as well - from dev_alloc_name(). It means the
>> rollback for a netdevice with a number > 0 will never happen. (The err
>> test is reordered btw. to make it more readable.)
>>
>> Signed-off-by: Jarek Poplawski <[email-masked]>
>> Cc: Eric Dumazet <[email-masked]>
> 
> Ok.
> 
> Eric please give your signoff and I'll put this where it needs
> to go.
> 

I finaly understood why I got stuck on this one : I thought dev_alloc_name()
was returning 0 in case of success. The test was thus realy obscure for me.

So Jarek patch is pretty clear now I saw the light !

Thanks

Signed-off-by: Eric Dumazet <[email-masked]>