staging: r8188eu: remove test in usbctrl_vendorreq()
authorFabio M. De Francesco <fmdefrancesco@gmail.com>
Fri, 24 Sep 2021 12:26:52 +0000 (14:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Sep 2021 15:37:11 +0000 (17:37 +0200)
Remove unnecessary test for "!io_buf" in usbctrl_vendorreq(). This test
is not necessary because io_buf has been assigned with the address of
a region of dynamically allocated memory (dvobj->usb_alloc_vendor_req_buf)
by rtw_init_intf_priv() in os_dep/usb_intf.c.

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-4-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/usb_ops_linux.c

index 84ec7c1346b127bb5b1a7994ac836fa5c5e506b5..61a016e3608f37c4423a7695bd927c91168271f1 100644 (file)
@@ -34,12 +34,6 @@ static int usbctrl_vendorreq(struct intf_hdl *intf, u16 value, void *data, u16 l
        /*  Acquire IO memory for vendorreq */
        io_buf = dvobjpriv->usb_vendor_req_buf;
 
-       if (!io_buf) {
-               DBG_88E("[%s] io_buf == NULL\n", __func__);
-               status = -ENOMEM;
-               goto release_mutex;
-       }
-
        if (requesttype == REALTEK_USB_VENQT_READ)
                pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
        else
@@ -91,7 +85,7 @@ static int usbctrl_vendorreq(struct intf_hdl *intf, u16 value, void *data, u16 l
                if ((value >= FW_8188E_START_ADDRESS && value <= FW_8188E_END_ADDRESS) || status == len)
                        break;
        }
-release_mutex:
+
        mutex_unlock(&dvobjpriv->usb_vendor_req_mutex);
 exit:
        return status;