linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/13] staging: rtl8188eu: handle errors from dev_alloc_name
@ 2021-06-20 17:52 Martin Kaiser
  2021-06-20 17:52 ` [PATCH 02/13] staging: rtl8188eu: remove RT_TRACE prints from usb_intf.c Martin Kaiser
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Martin Kaiser @ 2021-06-20 17:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-staging, kernel-janitors, linux-kernel, Martin Kaiser

Fail the usb interface initialization if dev_alloc_name returns an error.

Other wlan drivers like natsemi or atmel use the same error handling.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 5ca54dc36fa9..ee209b2fe4fe 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -387,8 +387,11 @@ static int rtw_usb_if1_init(struct usb_interface *pusb_intf)
 		pr_debug("can't get autopm:\n");
 
 	/*  alloc dev name after read efuse. */
-	if (dev_alloc_name(pnetdev, padapter->registrypriv.ifname) < 0)
+	err = dev_alloc_name(pnetdev, padapter->registrypriv.ifname);
+	if (err < 0) {
 		RT_TRACE(_module_os_intfs_c_, _drv_err_, ("dev_alloc_name, fail!\n"));
+		goto free_hal_data;
+	}
 
 	netif_carrier_off(pnetdev);
 
-- 
2.20.1


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

end of thread, other threads:[~2021-06-20 17:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-20 17:52 [PATCH 01/13] staging: rtl8188eu: handle errors from dev_alloc_name Martin Kaiser
2021-06-20 17:52 ` [PATCH 02/13] staging: rtl8188eu: remove RT_TRACE prints from usb_intf.c Martin Kaiser
2021-06-20 17:52 ` [PATCH 03/13] staging: rtl8188eu: remove RT_TRACE prints from rtl8188e_hal_init.c Martin Kaiser
2021-06-20 17:52 ` [PATCH 04/13] staging: rtl8188eu: remove a couple of unused defines Martin Kaiser
2021-06-20 17:52 ` [PATCH 05/13] staging: rtl8188eu: remove efuse type Martin Kaiser
2021-06-20 17:52 ` [PATCH 06/13] staging: rtl8188eu: remove unnecessary if clause Martin Kaiser
2021-06-20 17:52 ` [PATCH 07/13] staging: rtl8188eu: remove RT_TRACE and MSG_88E prints from usb_halinit.c Martin Kaiser
2021-06-20 17:52 ` [PATCH 08/13] staging: rtl8188eu: remove HAL_INIT_PROFILE_TAG Martin Kaiser
2021-06-20 17:52 ` [PATCH 09/13] staging: rtl8188eu: simplify rtl88eu_mon_init Martin Kaiser
2021-06-20 17:52 ` [PATCH 10/13] staging: rtl8188eu: remove RT_TRACE prints from pwrseqcmd.c Martin Kaiser
2021-06-20 17:52 ` [PATCH 11/13] staging: rtl8188eu: make efuse_ReadEFuse static Martin Kaiser
2021-06-20 17:53 ` [PATCH 12/13] staging: rtl8188eu: remove sdio defines Martin Kaiser
2021-06-20 17:53 ` [PATCH 13/13] staging: rtl8188eu: remove more unused defines Martin Kaiser

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).