From: Kangjie Lu <kjlu@umn.edu>
To: kjlu@umn.edu
Cc: pakki001@umn.edu, "Larry Finger" <Larry.Finger@lwfinger.net>,
"Florian Schilhabel" <florian.c.schilhabel@googlemail.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"André Lehmann" <lenneman@web.de>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] rtl8712: add a check for the status of register_netdev
Date: Tue, 25 Dec 2018 19:30:39 -0600 [thread overview]
Message-ID: <20181226013041.70740-1-kjlu@umn.edu> (raw)
register_netdev() may fail, so let's check its return value, and if it
fails, issue an error message.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
drivers/staging/rtl8712/hal_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c
index 7cdd609cab6c..7e2f8e0185d5 100644
--- a/drivers/staging/rtl8712/hal_init.c
+++ b/drivers/staging/rtl8712/hal_init.c
@@ -45,7 +45,8 @@ static void rtl871x_load_fw_cb(const struct firmware *firmware, void *context)
}
padapter->fw = firmware;
/* firmware available - start netdev */
- register_netdev(padapter->pnetdev);
+ if (register_netdev(padapter->pnetdev))
+ dev_err(&udev->dev, "r8712u: Registering netdev failed\n");
}
static const char firmware_file[] = "rtlwifi/rtl8712u.bin";
--
2.17.2 (Apple Git-113)
next reply other threads:[~2018-12-26 1:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-26 1:30 Kangjie Lu [this message]
2018-12-26 2:29 ` kbuild test robot
2018-12-26 2:31 ` kbuild test robot
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=20181226013041.70740-1-kjlu@umn.edu \
--to=kjlu@umn.edu \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=florian.c.schilhabel@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=lenneman@web.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pakki001@umn.edu \
/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®