All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipv6: remove superfluous nla_data() NULL pointer checks
@ 2013-03-09 15:57 Mathias Krause
  2013-03-10 20:47 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Mathias Krause @ 2013-03-09 15:57 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Mathias Krause

nla_data() cannot return NULL, so these NULL pointer checks are
superfluous.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
 net/ipv6/addrlabel.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
index aad6435..6f226c8 100644
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -436,10 +436,7 @@ static int ip6addrlbl_newdel(struct sk_buff *skb, struct nlmsghdr *nlh,
 
 	if (!tb[IFAL_ADDRESS])
 		return -EINVAL;
-
 	pfx = nla_data(tb[IFAL_ADDRESS]);
-	if (!pfx)
-		return -EINVAL;
 
 	if (!tb[IFAL_LABEL])
 		return -EINVAL;
@@ -561,10 +558,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh,
 
 	if (!tb[IFAL_ADDRESS])
 		return -EINVAL;
-
 	addr = nla_data(tb[IFAL_ADDRESS]);
-	if (!addr)
-		return -EINVAL;
 
 	rcu_read_lock();
 	p = __ipv6_addr_label(net, addr, ipv6_addr_type(addr), ifal->ifal_index);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipv6: remove superfluous nla_data() NULL pointer checks
  2013-03-09 15:57 [PATCH] ipv6: remove superfluous nla_data() NULL pointer checks Mathias Krause
@ 2013-03-10 20:47 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-03-10 20:47 UTC (permalink / raw)
  To: minipli; +Cc: netdev

From: Mathias Krause <minipli@googlemail.com>
Date: Sat,  9 Mar 2013 16:57:00 +0100

> nla_data() cannot return NULL, so these NULL pointer checks are
> superfluous.
> 
> Signed-off-by: Mathias Krause <minipli@googlemail.com>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-10 20:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-09 15:57 [PATCH] ipv6: remove superfluous nla_data() NULL pointer checks Mathias Krause
2013-03-10 20:47 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.