Re: [PATCH v2 5/5] net: mdio-mux: fix unbalanced put_device

From: Andrew Lunn
Date: Fri Sep 01 2017 - 09:38:58 EST


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 <clabbe.montjoie@xxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew