From: Paul Moore <paul@paul-moore.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] cipso: remove an unneeded NULL check in cipso_v4_doi_add()
Date: Wed, 12 Oct 2011 17:28:08 -0400 [thread overview]
Message-ID: <1993964.1HBym86W0O@sifl> (raw)
In-Reply-To: <20111011215549.GC30887@longonot.mountain>
On Wednesday, October 12, 2011 12:55:49 AM Dan Carpenter wrote:
> On Tue, Oct 11, 2011 at 05:20:11PM -0400, Paul Moore wrote:
> > > - if (doi_def == NULL || doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
> > > + if (doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
> > > goto doi_add_return;
> > > for (iter = 0; iter < CIPSO_V4_TAG_MAXCNT; iter++) {
> > > switch (doi_def->tags[iter]) {
> >
> > I'd prefer to keep the NULL check in there as it does afford a little
> > bit of extra safety and this is management code after all, not
> > per-packet processing code, so the extra check should have no
> > observable performance impact.
>
> The dereferences on the lines before mean we would Oops before
> reaching the check ...
Thanks for pointing that out, I missed that when looking at your patch.
--
paul moore
www.paul-moore.com
prev parent reply other threads:[~2011-10-12 21:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 13:22 [patch] cipso: remove an unneeded NULL check in cipso_v4_doi_add() Dan Carpenter
2011-10-11 21:20 ` Paul Moore
2011-10-11 21:55 ` Dan Carpenter
2011-10-11 22:42 ` David Miller
2011-10-12 21:28 ` Paul Moore [this message]
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=1993964.1HBym86W0O@sifl \
--to=paul@paul-moore.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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).