Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753581AbcDCOEm (ORCPT ); Sun, 3 Apr 2016 10:04:42 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:12220 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbcDCOEl (ORCPT ); Sun, 3 Apr 2016 10:04:41 -0400 X-RM-TRANSID: 2ee4570122b5a47-8de78 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee4570122b89b0-55e11 From: Haishuang Yan To: "David S. Miller" , Alexey Kuznetsov , James Morris Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH] netfilter: unnecessary to check whether ip6_route_output() returns NULL Date: Sun, 3 Apr 2016 22:03:33 +0800 Message-Id: <1459692213-3948-1-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 798 Lines: 25 ip6_route_output() never returns NULL, so it is not appropriate to check if the return value is NULL. Signed-off-by: Haishuang Yan --- net/ipv6/netfilter/nf_reject_ipv6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6/netfilter/nf_reject_ipv6.c index 4709f65..a540022 100644 --- a/net/ipv6/netfilter/nf_reject_ipv6.c +++ b/net/ipv6/netfilter/nf_reject_ipv6.c @@ -158,7 +158,7 @@ void nf_send_reset6(struct net *net, struct sk_buff *oldskb, int hook) fl6.fl6_dport = otcph->source; security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6)); dst = ip6_route_output(net, NULL, &fl6); - if (dst == NULL || dst->error) { + if (dst->error) { dst_release(dst); return; } -- 1.8.3.1