staging: rtl8712: fix error handling in r871xu_drv_init
authorPavel Skripkin <paskripkin@gmail.com>
Sun, 13 Jun 2021 22:00:13 +0000 (01:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jun 2021 14:48:09 +0000 (16:48 +0200)
commitd1d3e3cdfda8eb91f0e24be7ec8be1e6e01b3a1c
tree2d1ad5621f5702eeeb7dcf23f5b16c2fb52a70e4
parent69d998f1e552f6e2e7b55f5058ce1ac7a72903f9
staging: rtl8712: fix error handling in r871xu_drv_init

Previous error handling path was unique for all
possible errors and there was unnecessary branching.
Also, one step for freeing drv_sw was missing. All
these problems was fixed by restructuring error
handling path.

Also, moved out free_netdev() from r8712_free_drv_sw() for
correct error handling.

Fixes: 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/febb00f72354449bb4d305f373d6d2f47e539ab4.1623620630.git.paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/os_intfs.c
drivers/staging/rtl8712/usb_intf.c