summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Vaittinen <matti.vaittinen@nsn.com>2011-11-15 00:58:59 +0000
committerDavid S. Miller <davem@davemloft.net>2011-11-15 16:54:20 -0500
commit229a66e3bec97563aa92e25dfe0bc60b0d468619 (patch)
treef523a174ccf37d7e184248d6e3f25acc1be4c948
parentad79eefc42d56cb851a2b28a86e481cf1161005e (diff)
IPv6: Removing unnecessary NULL checks.
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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/ip6_fib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 9239d559b41..e8a0fcf8850 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -635,10 +635,9 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
{
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 fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
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))