]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: mdio-mux: Delete unnecessary devm_kfree
authorSaravana Kannan <saravanak@google.com>
Wed, 18 Aug 2021 03:38:01 +0000 (20:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Aug 2021 09:48:52 +0000 (10:48 +0100)
The whole point of devm_* APIs is that you don't have to undo them if you
are returning an error that's going to get propagated out of a probe()
function. So delete unnecessary devm_kfree() call in the error return path.

Fixes: b60161668199 ("mdio: mux: Correct mdio_mux_init error path issues")
Signed-off-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Marc Zyngier <maz@kernel.org>
Tested-by: Marc Zyngier <maz@kernel.org>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mdio/mdio-mux.c

index 110e4ee85785cce29f9a9b6c06556e6c480afa60..5b37284f54d683f12a71c510feaeaf8af9ac6cce 100644 (file)
@@ -181,7 +181,6 @@ int mdio_mux_init(struct device *dev,
        }
 
        dev_err(dev, "Error: No acceptable child buses found\n");
-       devm_kfree(dev, pb);
 err_pb_kz:
        put_device(&parent_bus->dev);
 err_parent_bus: