From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: [PATCH net-next 7/7] net/ipv6: Remove unncessary check on f6i in fib6_check Date: Fri, 20 Apr 2018 15:38:03 -0700 Message-ID: <20180420223803.15743-8-dsahern@gmail.com> References: <20180420223803.15743-1-dsahern@gmail.com> Cc: davem@davemloft.net, idosch@idosch.org, roopa@cumulusnetworks.com, eric.dumazet@gmail.com, weiwan@google.com, kafai@fb.com, yoshfuji@linux-ipv6.org, David Ahern To: netdev@vger.kernel.org Return-path: Received: from mail-pl0-f66.google.com ([209.85.160.66]:37058 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752609AbeDTWiV (ORCPT ); Fri, 20 Apr 2018 18:38:21 -0400 Received: by mail-pl0-f66.google.com with SMTP id f7-v6so5989113plr.4 for ; Fri, 20 Apr 2018 15:38:21 -0700 (PDT) In-Reply-To: <20180420223803.15743-1-dsahern@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Dan reported an imbalance in fib6_check on use of f6i and checking whether it is null. Since fib6_check is only called if f6i is non-null, remove the unnecessary check. Reported-by: Dan Carpenter Signed-off-by: David Ahern --- net/ipv6/route.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 004d00fe2fe5..0407bbc5a028 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2130,8 +2130,7 @@ static bool fib6_check(struct fib6_info *f6i, u32 cookie) { u32 rt_cookie = 0; - if ((f6i && !fib6_get_cookie_safe(f6i, &rt_cookie)) || - rt_cookie != cookie) + if (!fib6_get_cookie_safe(f6i, &rt_cookie) || rt_cookie != cookie) return false; if (fib6_check_expired(f6i)) -- 2.11.0