From: Matti Vaittinen <matti.vaittinen@nsn.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next] IPv6: Removing unnecessary NULL checks introduced in 4a287eba2de395713d8b2b2aeaa69fa086832d34.
Date: Tue, 15 Nov 2011 12:58:59 +0200 [thread overview]
Message-ID: <1321354739.1858.72.camel@hakki> (raw)
This patch removes unnecessary NULL checks noticed by Dan Carpenter.
Checks were introduced in commit
4a287eba2de395713d8b2b2aeaa69fa086832d34 to net-next.
Signed-off-by: Matti Vaittinen <Mazziesaccount@gmail.com>
--
diff -uNr commit4a287eba2de395713d8b2b2aeaa69fa086832d34.orig/net/ipv6/ip6_fib.c commit4a287eba2de395713d8b2b2aeaa69fa086832d34.new/net/ipv6/ip6_fib.c
--- commit4a287eba2de395713d8b2b2aeaa69fa086832d34.orig/net/ipv6/ip6_fib.c 2011-11-15 12:17:37.000000000 +0200
+++ commit4a287eba2de395713d8b2b2aeaa69fa086832d34.new/net/ipv6/ip6_fib.c 2011-11-15 12:25:59.000000000 +0200
@@ -635,10 +635,9 @@
{
struct rt6_info *iter = NULL;
struct rt6_info **ins;
- int replace = (NULL != info &&
- NULL != info->nlh &&
+ int replace = (NULL != info->nlh &&
(info->nlh->nlmsg_flags&NLM_F_REPLACE));
- int add = ((NULL == info || NULL == info->nlh) ||
+ int add = (NULL == info->nlh ||
(info->nlh->nlmsg_flags&NLM_F_CREATE));
int found = 0;
@@ -755,7 +754,7 @@
int err = -ENOMEM;
int allow_create = 1;
int replace_required = 0;
- if (NULL != info && NULL != info->nlh) {
+ if (NULL != info->nlh) {
if (!(info->nlh->nlmsg_flags&NLM_F_CREATE))
allow_create = 0;
if ((info->nlh->nlmsg_flags&NLM_F_REPLACE))
--
Matti Vaittinen
+358 504863070
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Told a UDP joke the other night...
...but I'm not sure everyone got it...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next reply other threads:[~2011-11-15 10:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-15 10:58 Matti Vaittinen [this message]
2011-11-15 21:55 ` [PATCH net-next] IPv6: Removing unnecessary NULL checks introduced in 4a287eba2de395713d8b2b2aeaa69fa086832d34 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=1321354739.1858.72.camel@hakki \
--to=matti.vaittinen@nsn.com \
--cc=davem@davemloft.net \
--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).