提交 229a66e3 编写于 作者: M Matti Vaittinen 提交者: David S. Miller

IPv6: Removing unnecessary NULL checks.

This patch removes unnecessary NULL checks noticed by Dan Carpenter.
Checks were introduced in commit
4a287eba to net-next.
Signed-off-by: NMatti Vaittinen <Mazziesaccount@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ad79eefc
...@@ -635,10 +635,9 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, ...@@ -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 *iter = NULL;
struct rt6_info **ins; struct rt6_info **ins;
int replace = (NULL != info && int replace = (NULL != info->nlh &&
NULL != info->nlh &&
(info->nlh->nlmsg_flags&NLM_F_REPLACE)); (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)); (info->nlh->nlmsg_flags&NLM_F_CREATE));
int found = 0; int found = 0;
...@@ -755,7 +754,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) ...@@ -755,7 +754,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
int err = -ENOMEM; int err = -ENOMEM;
int allow_create = 1; int allow_create = 1;
int replace_required = 0; int replace_required = 0;
if (NULL != info && NULL != info->nlh) { if (NULL != info->nlh) {
if (!(info->nlh->nlmsg_flags&NLM_F_CREATE)) if (!(info->nlh->nlmsg_flags&NLM_F_CREATE))
allow_create = 0; allow_create = 0;
if ((info->nlh->nlmsg_flags&NLM_F_REPLACE)) if ((info->nlh->nlmsg_flags&NLM_F_REPLACE))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册