Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbdIANix (ORCPT ); Fri, 1 Sep 2017 09:38:53 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:49357 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752072AbdIANiv (ORCPT ); Fri, 1 Sep 2017 09:38:51 -0400 Date: Fri, 1 Sep 2017 15:38:50 +0200 From: Andrew Lunn To: Corentin Labbe Cc: f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/5] net: mdio-mux: fix unbalanced put_device Message-ID: <20170901133850.GA22289@lunn.ch> References: <20170901115604.27513-1-clabbe.montjoie@gmail.com> <20170901115604.27513-6-clabbe.montjoie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170901115604.27513-6-clabbe.montjoie@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 500 Lines: 14 On Fri, Sep 01, 2017 at 01:56:04PM +0200, Corentin Labbe wrote: > mdio_mux_uninit() call put_device (unconditionally) because of > of_mdio_find_bus() in mdio_mux_init. > But of_mdio_find_bus is only called if mux_bus is empty. > If mux_bus is set, mdio_mux_uninit will print a "refcount_t: underflow" > trace. > > This patch add a get_device in the other branch of "if (mux_bus)". > > Signed-off-by: Corentin Labbe Reviewed-by: Andrew Lunn Andrew