Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753608AbcKYIhN (ORCPT ); Fri, 25 Nov 2016 03:37:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:45254 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753357AbcKYIc5 (ORCPT ); Fri, 25 Nov 2016 03:32:57 -0500 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, WANG Cong , "David S . Miller" , Jiri Slaby Subject: [PATCH 3.12 107/127] neigh: check error pointer instead of NULL for ipv4_neigh_lookup() Date: Fri, 25 Nov 2016 09:30:20 +0100 Message-Id: <9fe2e2cbbec2133db8e781951569b0f0fe4a4b98.1480062521.git.jslaby@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 975 Lines: 32 From: WANG Cong 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit 2c1a4311b61072afe2309d4152a7993e92caa41c upstream. Fixes: commit f187bc6efb7250afee0e2009b6106 ("ipv4: No need to set generic neighbour pointer") Cc: David S. Miller Signed-off-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Jiri Slaby --- 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 2d709773dc6c..f1631aec4206 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -765,7 +765,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 { -- 2.10.2