From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:60642 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932086AbdEKJrN (ORCPT ); Thu, 11 May 2017 05:47:13 -0400 Subject: Patch "net: mdio-mux: bcm-iproc: call mdiobus_free() in error path" has been added to the 4.9-stable tree To: jon.mason@broadcom.com, davem@davemloft.net, f.fainelli@gmail.com, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 11 May 2017 11:46:56 +0200 Message-ID: <14944960167118@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled net: mdio-mux: bcm-iproc: call mdiobus_free() in error path to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-mdio-mux-bcm-iproc-call-mdiobus_free-in-error-path.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu May 11 11:08:24 CEST 2017 From: Jon Mason Date: Mon, 8 May 2017 17:48:35 -0400 Subject: net: mdio-mux: bcm-iproc: call mdiobus_free() in error path From: Jon Mason [ Upstream commit 922c60e89d52730050c6ccca218bff40cc8bcd8e ] If an error is encountered in mdio_mux_init(), the error path will call mdiobus_free(). Since mdiobus_register() has been called prior to mdio_mux_init(), the bus->state will not be MDIOBUS_UNREGISTERED. This causes a BUG_ON() in mdiobus_free(). To correct this issue, add an error path for mdio_mux_init() which calls mdiobus_unregister() prior to mdiobus_free(). Signed-off-by: Jon Mason Fixes: 98bc865a1ec8 ("net: mdio-mux: Add MDIO mux driver for iProc SoCs") Acked-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/mdio-mux-bcm-iproc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/net/phy/mdio-mux-bcm-iproc.c +++ b/drivers/net/phy/mdio-mux-bcm-iproc.c @@ -203,11 +203,14 @@ static int mdio_mux_iproc_probe(struct p &md->mux_handle, md, md->mii_bus); if (rc) { dev_info(md->dev, "mdiomux initialization failed\n"); - goto out; + goto out_register; } dev_info(md->dev, "iProc mdiomux registered\n"); return 0; + +out_register: + mdiobus_unregister(bus); out: mdiobus_free(bus); return rc; Patches currently in stable-queue which might be from jon.mason@broadcom.com are queue-4.9/arm-dts-nsp-gpio-reboot-open-source.patch queue-4.9/net-mdio-mux-bcm-iproc-call-mdiobus_free-in-error-path.patch