lkml.org 
[lkml]   [2015]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] atm: deal with setting entry before mkip was called
On 09/14/2015 12:50 PM, Eric Dumazet wrote:
> On Mon, 2015-09-14 at 11:48 -0400, Sasha Levin wrote:
>
>>
>> diff --git a/net/atm/clip.c b/net/atm/clip.c
>> index 17e55df..4407b2f 100644
>> --- a/net/atm/clip.c
>> +++ b/net/atm/clip.c
>> @@ -317,6 +317,9 @@ static int clip_constructor(struct neighbour *neigh)
>>
>> static int clip_encap(struct atm_vcc *vcc, int mode)
>> {
>> + if (!CLIP_VCC(vcc))
>> + return -EBADF;
>> +
>> CLIP_VCC(vcc)->encap = mode;
>> return 0;
>> }
>
>
> -EBADF has a very precise meaning : /* Bad file number */
>
> In this case, the file number is correct (and maps to a proper file),
> but driver state is not allowing for this particular operation.

I've tried to be consistent with a similar check within clip_mkip() and
clip_setentry():

if (!vcc->push)
return -EBADFD;

So calling clip_setentry() before clip_mkip() would also give you -EBADFD.


Thanks,
Sasha


\
 
 \ /
  Last update: 2015-09-14 19:21    [W:0.047 / U:0.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site