mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rtl8712: add a check for the status of register_netdev
@ 2018-12-26  1:30 Kangjie Lu
  2018-12-26  2:29 ` kbuild test robot
  2018-12-26  2:31 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Kangjie Lu @ 2018-12-26  1:30 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Larry Finger, Florian Schilhabel, Greg Kroah-Hartman,
	André Lehmann, devel, linux-kernel

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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-26  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26  1:30 [PATCH] rtl8712: add a check for the status of register_netdev Kangjie Lu
2018-12-26  2:29 ` kbuild test robot
2018-12-26  2:31 ` kbuild test robot

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®