Commit cf65514a authored by Ivan Safonov's avatar Ivan Safonov Committed by Greg Kroah-Hartman

staging: r8188eu: remove usb_vendor_req_buf member of dvobj_priv

Memory allocation moved into usbctrl_vendorreq function.
Signed-off-by: default avatarIvan Safonov <insafonov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bbd8a458
...@@ -157,8 +157,6 @@ struct dvobj_priv { ...@@ -157,8 +157,6 @@ struct dvobj_priv {
int ep_num[5]; /* endpoint number */ int ep_num[5]; /* endpoint number */
struct mutex usb_vendor_req_mutex; struct mutex usb_vendor_req_mutex;
u8 *usb_vendor_req_buf;
struct usb_interface *pusbintf; struct usb_interface *pusbintf;
struct usb_device *pusbdev; struct usb_device *pusbdev;
}; };
......
...@@ -107,13 +107,6 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf) ...@@ -107,13 +107,6 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
pdvobjpriv->ishighspeed = false; pdvobjpriv->ishighspeed = false;
mutex_init(&pdvobjpriv->usb_vendor_req_mutex); 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); usb_get_dev(pusbd);
return pdvobjpriv; return pdvobjpriv;
...@@ -141,7 +134,6 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf) ...@@ -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); mutex_destroy(&dvobj->usb_vendor_req_mutex);
kfree(dvobj); kfree(dvobj);
} }
......
...@@ -251,7 +251,7 @@ static int usbctrl_vendorreq(struct adapter *adapt, u8 request, u16 value, u16 i ...@@ -251,7 +251,7 @@ static int usbctrl_vendorreq(struct adapter *adapt, u8 request, u16 value, u16 i
} }
/* Acquire IO memory for vendorreq */ /* 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) { if (pIo_buf == NULL) {
DBG_88E("[%s] pIo_buf == NULL\n", __func__); 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 ...@@ -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) if ((value >= FW_8188E_START_ADDRESS && value <= FW_8188E_END_ADDRESS) || status == len)
break; break;
} }
kfree(pIo_buf);
release_mutex: release_mutex:
mutex_unlock(&dvobjpriv->usb_vendor_req_mutex); mutex_unlock(&dvobjpriv->usb_vendor_req_mutex);
exit: exit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment