Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1285280 > unrolled thread

[PATCH v3 net-next 3/4] net: dsa: Add missing master netdev dev_put() calls

Started byNeil Armstrong <narmstrong@baylibre.com>
First post2015-12-07 14:00 +0100
Last post2015-12-07 14:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 net-next 3/4] net: dsa: Add missing master netdev dev_put() calls Neil Armstrong <narmstrong@baylibre.com> - 2015-12-07 14:00 +0100

#1285280 — [PATCH v3 net-next 3/4] net: dsa: Add missing master netdev dev_put() calls

FromNeil Armstrong <narmstrong@baylibre.com>
Date2015-12-07 14:00 +0100
Subject[PATCH v3 net-next 3/4] net: dsa: Add missing master netdev dev_put() calls
Message-ID<qD3yz-4AE-29@gated-at.bofh.it>
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 d9e0172..d22d303e 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)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web