Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matti Vaittinen and committed by
David S. Miller
229a66e3 ad79eefc

+3 -4
+3 -4
net/ipv6/ip6_fib.c
··· 635 635 { 636 636 struct rt6_info *iter = NULL; 637 637 struct rt6_info **ins; 638 - int replace = (NULL != info && 639 - NULL != info->nlh && 638 + int replace = (NULL != info->nlh && 640 639 (info->nlh->nlmsg_flags&NLM_F_REPLACE)); 641 - int add = ((NULL == info || NULL == info->nlh) || 640 + int add = (NULL == info->nlh || 642 641 (info->nlh->nlmsg_flags&NLM_F_CREATE)); 643 642 int found = 0; 644 643 ··· 754 755 int err = -ENOMEM; 755 756 int allow_create = 1; 756 757 int replace_required = 0; 757 - if (NULL != info && NULL != info->nlh) { 758 + if (NULL != info->nlh) { 758 759 if (!(info->nlh->nlmsg_flags&NLM_F_CREATE)) 759 760 allow_create = 0; 760 761 if ((info->nlh->nlmsg_flags&NLM_F_REPLACE))