]> git.baikalelectronics.ru Git - kernel.git/commit
net: mdio-mux: fix unbalanced put_device
authorCorentin Labbe <clabbe.montjoie@gmail.com>
Fri, 1 Sep 2017 11:56:04 +0000 (13:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Sep 2017 17:26:31 +0000 (10:26 -0700)
commit4ef9abb35f065df3e59a127456220004af8175e3
treeea3186a5c85b0aef63557f9fab44929841df5fd9
parentdbd0fd527ddc0a9e6a6a7195ec00f590777cb992
net: mdio-mux: fix unbalanced put_device

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@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio-mux.c