From: David Miller Subject: Re: [Patch net] ipv6: fix double refcount of fib6_metrics Date: Fri, 03 Aug 2018 12:38:48 -0700 (PDT) Message-ID: <20180803.123848.1603096218067358819.davem@davemloft.net> References: <20180803062038.13272-1-xiyou.wangcong@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, sd@queasysnail.net, dsahern@gmail.com To: xiyou.wangcong@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:38610 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728139AbeHCVg3 (ORCPT ); Fri, 3 Aug 2018 17:36:29 -0400 In-Reply-To: <20180803062038.13272-1-xiyou.wangcong@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Cong Wang Date: Thu, 2 Aug 2018 23:20:38 -0700 > All the callers of ip6_rt_copy_init()/rt6_set_from() hold refcnt > of the "from" fib6_info, so there is no need to hold fib6_metrics > refcnt again, because fib6_metrics refcnt is only released when > fib6_info is gone, that is, they have the same life time, so the > whole fib6_metrics refcnt can be removed actually. > > This fixes a kmemleak warning reported by Sabrina. > > Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes") > Reported-by: Sabrina Dubroca > Cc: Sabrina Dubroca > Cc: David Ahern > Signed-off-by: Cong Wang Sabrina, please review!