* [PATCH 4/6] net: dsa: Add missing master netdev dev_put() calls
@ 2015-10-27 14:49 Neil Armstrong
0 siblings, 0 replies; only message in thread
From: Neil Armstrong @ 2015-10-27 14:49 UTC (permalink / raw)
To: David S. Miller
Cc: Andrew Lunn, Florian Fainelli, Guenter Roeck, vivien.didelot,
Fabian Frederick, Pavel Nakonechny, Joe Perches, netdev,
linux-kernel, Frode Isaksen
Upon probe failure or unbinding, add missing dev_put() calls.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
net/dsa/dsa.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index acbf854..9240a46 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -931,8 +931,10 @@ static int dsa_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dst);
ret = dsa_setup_dst(dst, dev, &pdev->dev, pd);
- if (ret)
+ if (ret) {
+ dev_put(dev);
goto out;
+ }
return 0;
@@ -965,6 +967,8 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst)
if (ds)
dsa_switch_destroy(ds);
}
+
+ dev_put(dst->master_netdev);
}
static int dsa_remove(struct platform_device *pdev)
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-27 14:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-27 14:49 [PATCH 4/6] net: dsa: Add missing master netdev dev_put() calls Neil Armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).