Netdev List
 help / color / mirror / Atom feed
* [PATCH] neigh: check error pointer instead of NULL for ipv4_neigh_lookup()
@ 2014-09-25  0:07 Cong Wang
  2014-09-25 15:35 ` Alexei Starovoitov
  2014-09-28 21:16 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Cong Wang @ 2014-09-25  0:07 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, David S. Miller

Fixes: commit f187bc6efb7250afee0e2009b6106 ("ipv4: No need to set generic neighbour pointer")
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/ipv4/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 173e7ea..cbadb94 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -746,7 +746,7 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow
 	}
 
 	n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw);
-	if (n) {
+	if (!IS_ERR(n)) {
 		if (!(n->nud_state & NUD_VALID)) {
 			neigh_event_send(n, NULL);
 		} else {
-- 
1.8.3.1

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

end of thread, other threads:[~2014-09-28 21:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-25  0:07 [PATCH] neigh: check error pointer instead of NULL for ipv4_neigh_lookup() Cong Wang
2014-09-25 15:35 ` Alexei Starovoitov
2014-09-25 16:18   ` Cong Wang
2014-09-28 21:16 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox