lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Nov 2011 12:58:59 +0200
From:	Matti Vaittinen <matti.vaittinen@....com>
To:	davem@...emloft.net
Cc:	netdev@...r.kernel.org
Subject: [PATCH net-next] IPv6: Removing unnecessary NULL checks introduced
 in 4a287eba2de395713d8b2b2aeaa69fa086832d34.


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@...il.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...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ