From: Sasha Levin <sasha.levin@oracle.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] atm: deal with setting entry before mkip was called
Date: Mon, 14 Sep 2015 13:00:26 -0400 [thread overview]
Message-ID: <55F6FD2A.7080004@oracle.com> (raw)
In-Reply-To: <1442249450.14284.5.camel@edumazet-glaptop2.roam.corp.google.com>
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
next prev parent reply other threads:[~2015-09-14 17:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 15:48 [PATCH] atm: deal with setting entry before mkip was called Sasha Levin
2015-09-14 16:50 ` Eric Dumazet
2015-09-14 17:00 ` Sasha Levin [this message]
2015-09-14 17:07 ` Eric Dumazet
2015-09-14 17:08 ` Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F6FD2A.7080004@oracle.com \
--to=sasha.levin@oracle.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).