mirror of https://gitee.com/openkylin/linux.git
staging: rtl8188eu: handle errors from dev_alloc_name
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> Link: https://lore.kernel.org/r/20210620175301.14988-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
deefd9211d
commit
c1ccff4682
|
@ -387,8 +387,11 @@ static int rtw_usb_if1_init(struct usb_interface *pusb_intf)
|
||||||
pr_debug("can't get autopm:\n");
|
pr_debug("can't get autopm:\n");
|
||||||
|
|
||||||
/* alloc dev name after read efuse. */
|
/* 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"));
|
RT_TRACE(_module_os_intfs_c_, _drv_err_, ("dev_alloc_name, fail!\n"));
|
||||||
|
goto free_hal_data;
|
||||||
|
}
|
||||||
|
|
||||||
netif_carrier_off(pnetdev);
|
netif_carrier_off(pnetdev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue