From: Neil Armstrong <narmstrong@baylibre.com>
To: davem@davemloft.net, andrew@lunn.ch, f.fainelli@gmail.com,
linux@roeck-us.net, vivien.didelot@savoirfairelinux.com,
fabf@skynet.be, pavel.nakonechny@skitlab.ru, joe@perches.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Neil Armstrong <narmstrong@baylibre.com>
Subject: [PATCH v3 net-next 3/4] net: dsa: Add missing master netdev dev_put() calls
Date: Mon, 7 Dec 2015 13:57:34 +0100 [thread overview]
Message-ID: <1449493055-29047-4-git-send-email-narmstrong@baylibre.com> (raw)
In-Reply-To: <1449493055-29047-1-git-send-email-narmstrong@baylibre.com>
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
next prev parent reply other threads:[~2015-12-07 12:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-29 13:22 [PATCH v2 0/6] Further fix for dsa unbinding Neil Armstrong
2015-12-07 12:57 ` [PATCH v3 net-next 0/4] " Neil Armstrong
2015-12-07 12:57 ` [PATCH v3 net-next 1/4] net: dsa: remove DSA link polling Neil Armstrong
2015-12-07 12:57 ` [PATCH v3 net-next 2/4] net: dsa: cleanup resources upon module removal Neil Armstrong
2015-12-07 12:57 ` Neil Armstrong [this message]
2015-12-07 12:57 ` [PATCH v3 net-next 4/4] net: dsa: move dsa slave destroy code to slave.c Neil Armstrong
2015-12-07 14:28 ` [PATCH v3 net-next 0/4] Further fix for dsa unbinding Andrew Lunn
2015-12-07 20:39 ` Florian Fainelli
2015-12-07 21:36 ` David Miller
2016-03-08 9:36 ` [PATCH] net: dsa: Fix cleanup resources upon module removal Neil Armstrong
2016-03-08 14:52 ` Andrew Lunn
2016-03-10 21:21 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449493055-29047-4-git-send-email-narmstrong@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=fabf@skynet.be \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=netdev@vger.kernel.org \
--cc=pavel.nakonechny@skitlab.ru \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®