From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [patch net] mlxsw: spectrum_router: Free LPM tree upon failure Date: Thu, 18 Jan 2018 20:57:17 -0500 (EST) Message-ID: <20180118.205717.382930558863083200.davem@davemloft.net> References: <20180118144210.4653-1-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, idosch@mellanox.com, mlxsw@mellanox.com To: jiri@resnulli.us Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:33410 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755454AbeASB5V (ORCPT ); Thu, 18 Jan 2018 20:57:21 -0500 In-Reply-To: <20180118144210.4653-1-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: From: Jiri Pirko Date: Thu, 18 Jan 2018 15:42:10 +0100 > From: Ido Schimmel > > When a new LPM tree is created, we try to replace the trees in the > existing virtual routers with it. If we fail, the tree needs to be > freed. > > Currently, this does not happen in the unlikely case where we fail to > bind the tree to the first virtual router, since its reference count > never transitions from 1 to 0. > > Fix that by taking a reference before binding the tree. > > Fixes: fc922bb0dd94 ("mlxsw: spectrum_router: Use one LPM tree for all virtual routers") > Signed-off-by: Ido Schimmel > Signed-off-by: Jiri Pirko Applied, thanks Jiri.