summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvan Safonov <insafonov@gmail.com>2016-09-03 22:30:19 +0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-12 11:23:21 +0200
commitcf65514a6adcb3f6a30d4176687f14a8014b712b (patch)
tree032ae0051dfede5b4c45eb51cd81d2d4db105ea2 /drivers
parentbbd8a4584235c5492209d79ebcaa7c817585c1ba (diff)
downloadlinux-cf65514a6adcb3f6a30d4176687f14a8014b712b.tar.bz2
staging: r8188eu: remove usb_vendor_req_buf member of dvobj_priv
Memory allocation moved into usbctrl_vendorreq function. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rtl8188eu/include/drv_types.h2
-rw-r--r--drivers/staging/rtl8188eu/os_dep/usb_intf.c8
-rw-r--r--drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c4
3 files changed, 3 insertions, 11 deletions
diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h
index 32b46128075d..92807a449966 100644
--- a/drivers/staging/rtl8188eu/include/drv_types.h
+++ b/drivers/staging/rtl8188eu/include/drv_types.h
@@ -157,8 +157,6 @@ struct dvobj_priv {
int ep_num[5]; /* endpoint number */
struct mutex usb_vendor_req_mutex;
- u8 *usb_vendor_req_buf;
-
struct usb_interface *pusbintf;
struct usb_device *pusbdev;
};
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 7da3534f15f7..16effd791d6a 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -107,13 +107,6 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
pdvobjpriv->ishighspeed = false;
mutex_init(&pdvobjpriv->usb_vendor_req_mutex);
- pdvobjpriv->usb_vendor_req_buf = kzalloc(MAX_USB_IO_CTL_SIZE, GFP_KERNEL);
-
- if (!pdvobjpriv->usb_vendor_req_buf) {
- usb_set_intfdata(usb_intf, NULL);
- kfree(pdvobjpriv);
- return NULL;
- }
usb_get_dev(pusbd);
return pdvobjpriv;
@@ -141,7 +134,6 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)
}
}
- kfree(dvobj->usb_vendor_req_buf);
mutex_destroy(&dvobj->usb_vendor_req_mutex);
kfree(dvobj);
}
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index ce1e1a135f1b..abb476b8f1c5 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -251,7 +251,7 @@ static int usbctrl_vendorreq(struct adapter *adapt, u8 request, u16 value, u16 i
}
/* Acquire IO memory for vendorreq */
- pIo_buf = dvobjpriv->usb_vendor_req_buf;
+ pIo_buf = kmalloc(MAX_USB_IO_CTL_SIZE, GFP_ATOMIC);
if (pIo_buf == NULL) {
DBG_88E("[%s] pIo_buf == NULL\n", __func__);
@@ -303,6 +303,8 @@ static int usbctrl_vendorreq(struct adapter *adapt, u8 request, u16 value, u16 i
if ((value >= FW_8188E_START_ADDRESS && value <= FW_8188E_END_ADDRESS) || status == len)
break;
}
+ kfree(pIo_buf);
+
release_mutex:
mutex_unlock(&dvobjpriv->usb_vendor_req_mutex);
exit: