netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: John Fastabend <john.fastabend@gmail.com>,
	netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com
Subject: Re: [patch net-next 1/2] net: sched: cls_basic: fix error path in basic_change()
Date: Mon, 8 Dec 2014 08:27:56 +0100	[thread overview]
Message-ID: <20141208072756.GA1863@nanopsycho.orion> (raw)
In-Reply-To: <1417795431.15618.6.camel@edumazet-glaptop2.roam.corp.google.com>

Fri, Dec 05, 2014 at 05:03:51PM CET, eric.dumazet@gmail.com wrote:
>On Fri, 2014-12-05 at 07:29 -0800, John Fastabend wrote:
>> On 12/05/2014 06:50 AM, Jiri Pirko wrote:
>> > Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> > ---
>> >   net/sched/cls_basic.c | 5 ++---
>> >   1 file changed, 2 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
>> > index 7cf0a62..5aed341 100644
>> > --- a/net/sched/cls_basic.c
>> > +++ b/net/sched/cls_basic.c
>> > @@ -178,10 +178,9 @@ static int basic_change(struct net *net, struct sk_buff *in_skb,
>> >   			return -EINVAL;
>> >   	}
>> >
>> > -	err = -ENOBUFS;
>> >   	fnew = kzalloc(sizeof(*fnew), GFP_KERNEL);
>> > -	if (fnew == NULL)
>> > -		goto errout;
>> > +	if (!fnew)
>> > +		return -ENOBUFS;
>> >
>> >   	tcf_exts_init(&fnew->exts, TCA_BASIC_ACT, TCA_BASIC_POLICE);
>> >   	err = -EINVAL;
>> >
>> 
>> Nice catch, thanks!
>> 
>> Reviewed-by: John Fastabend <john.r.fastabend@intel.com>
>
>Sorry, but this looks a cosmetic change, right ?
>
>If it is a fix, we'd like a 'Fixes: ...' tag.

Yep, cosmetic, no need to go to kfree in case kzalloc fails.

  parent reply	other threads:[~2014-12-08  7:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 14:50 [patch net-next 1/2] net: sched: cls_basic: fix error path in basic_change() Jiri Pirko
2014-12-05 14:50 ` [patch net-next 2/2] net: sched: cls: use nla_nest_cancel instead of nlmsg_trim Jiri Pirko
2014-12-09 20:42   ` David Miller
2014-12-09 20:48     ` David Miller
2014-12-09 21:23       ` [patch net-next v2] " Jiri Pirko
2014-12-10  2:51         ` David Miller
2014-12-05 15:29 ` [patch net-next 1/2] net: sched: cls_basic: fix error path in basic_change() John Fastabend
2014-12-05 16:03   ` Eric Dumazet
2014-12-05 16:34     ` John Fastabend
2014-12-08  7:27     ` Jiri Pirko [this message]
2014-12-05 17:07 ` Sergei Shtylyov
2014-12-09 20:42 ` David Miller

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=20141208072756.GA1863@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=john.fastabend@gmail.com \
    --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).