From: Jarek Poplawski <jarkao2@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Jamal Hadi Salim <hadi@cyberus.ca>,
"David S. Miller" <davem@davemloft.net>,
Patrick McHardy <kaber@trash.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Stephen Hemminger <shemminger@vyatta.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] net/sched: remove unneeded NULL check
Date: Mon, 16 Aug 2010 10:14:32 +0000 [thread overview]
Message-ID: <20100816101432.GB8547@ff.dom.local> (raw)
In-Reply-To: <20100814210949.GB645@bicker>
Dan Carpenter wrote:
> There is no need to check "s". nla_data() doesn't return NULL. Also we
> already dereferenced "s" at this point so it would have oopsed ealier if
> it were NULL.
Looks OK to me.
Jarek P.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index 408eea7..6fb3d41 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -360,7 +360,7 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt)
> tsize = nla_len(tb[TCA_STAB_DATA]) / sizeof(u16);
> }
>
> - if (!s || tsize != s->tsize || (!tab && tsize > 0))
> + if (tsize != s->tsize || (!tab && tsize > 0))
> return ERR_PTR(-EINVAL);
>
> spin_lock(&qdisc_stab_lock);
> --
next prev parent reply other threads:[~2010-08-16 10:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-14 21:09 [patch] net/sched: remove unneeded NULL check Dan Carpenter
2010-08-16 10:14 ` Jarek Poplawski [this message]
2010-08-18 21:27 ` 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=20100816101432.GB8547@ff.dom.local \
--to=jarkao2@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=error27@gmail.com \
--cc=hadi@cyberus.ca \
--cc=kaber@trash.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/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