From: Martin Pitt <martin.pitt@ubuntu.com>
To: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Johannes Berg <johannes@sipsolutions.net>
Subject: mac80211_hwsim: Check return value of driver_register
Date: Wed, 10 Apr 2013 18:40:27 +0200 [thread overview]
Message-ID: <20130410164027.GB2884@piware.de> (raw)
If driver_register() fails, properly exit with the same error code.
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
---
drivers/net/wireless/mac80211_hwsim.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 57361c3..a2224b7 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2183,7 +2183,12 @@ static int __init init_mac80211_hwsim(void)
if (IS_ERR(hwsim_class))
return PTR_ERR(hwsim_class);
- driver_register(&mac80211_hwsim_driver);
+ err = driver_register(&mac80211_hwsim_driver);
+ if (err != 0) {
+ printk(KERN_DEBUG
+ "mac80211_hwsim: driver_register failed (%d)\n", err);
+ return err;
+ }
memset(addr, 0, ETH_ALEN);
addr[0] = 0x02;
--
1.7.2.5
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
next reply other threads:[~2013-04-10 16:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 16:40 Martin Pitt [this message]
2013-04-10 17:05 ` mac80211_hwsim: Check return value of driver_register Johannes Berg
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=20130410164027.GB2884@piware.de \
--to=martin.pitt@ubuntu.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).