aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/r8188eu/os_dep/xmit_linux.c
diff options
context:
space:
mode:
authorIvan Safonov <insafonov@gmail.com>2022-04-17 19:36:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-20 18:37:35 +0200
commit96b6efb72d1413fab4d9e7be9a87f7d2b191a3fb (patch)
tree70e587a63c613a3d8547062a922cc7ba0dad1dd8 /drivers/staging/r8188eu/os_dep/xmit_linux.c
parentstaging: r8188eu: use ARRAY_SIZE for mlme_sta_tbl (diff)
downloadlinux-dev-96b6efb72d1413fab4d9e7be9a87f7d2b191a3fb.tar.xz
linux-dev-96b6efb72d1413fab4d9e7be9a87f7d2b191a3fb.zip
r8188eu: remove unused urbs from struct xmit_buf
Driver allocates eighth urbs per xmit_buf, but uses only first urb. Allocation of seven remaining urbs wastes memory for nothing. Reviewed-by: Pavel Skripkin <paskripkin@gmail.com> Signed-off-by: Ivan Safonov <insafonov@gmail.com> Link: https://lore.kernel.org/r/20220417163608.42917-1-insafonov@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/staging/r8188eu/os_dep/xmit_linux.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/staging/r8188eu/os_dep/xmit_linux.c b/drivers/staging/r8188eu/os_dep/xmit_linux.c
index a6012cffd37e..e430c64e9068 100644
--- a/drivers/staging/r8188eu/os_dep/xmit_linux.c
+++ b/drivers/staging/r8188eu/os_dep/xmit_linux.c
@@ -67,8 +67,6 @@ bool rtw_endofpktfile(struct pkt_file *pfile)
int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz)
{
- int i;
-
pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
if (!pxmitbuf->pallocated_buf)
return _FAIL;
@@ -76,21 +74,17 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
pxmitbuf->dma_transfer_addr = 0;
- for (i = 0; i < 8; i++) {
- pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
- if (!pxmitbuf->pxmit_urb[i])
- return _FAIL;
- }
+ pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL);
+ if (!pxmitbuf->pxmit_urb)
+ return _FAIL;
+
return _SUCCESS;
}
void rtw_os_xmit_resource_free(struct adapter *padapter,
struct xmit_buf *pxmitbuf, u32 free_sz)
{
- int i;
-
- for (i = 0; i < 8; i++)
- usb_free_urb(pxmitbuf->pxmit_urb[i]);
+ usb_free_urb(pxmitbuf->pxmit_urb);
kfree(pxmitbuf->pallocated_buf);
}