summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2015-12-07 13:57:34 +0100
committerDavid S. Miller <davem@davemloft.net>2015-12-07 16:35:50 -0500
commit679fb46c57859b59a70257477bfbdfc7edfac4f5 (patch)
tree0d1641f0b9a16999ae1a72b084c9e62cc51c0091 /net/dsa
parentb0dc635d923cd5aafa4e99973f529bf68c582738 (diff)
downloadlinux-679fb46c57859b59a70257477bfbdfc7edfac4f5.tar.bz2
net: dsa: Add missing master netdev dev_put() calls
Upon probe failure or unbinding, add missing dev_put() calls. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/dsa.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index d9e0172116b6..d22d303efd5c 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -919,8 +919,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;
@@ -940,6 +942,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)