staging: r8188eu: add kfree() on an error path of rtw_xmit_resource_alloc()
authorXiaoke Wang <xkernel.wang@foxmail.com>
Mon, 12 Sep 2022 02:50:26 +0000 (10:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2022 11:08:41 +0000 (13:08 +0200)
commitf63ed6cf93014c7fac56d82069801a26ab8b04a6
treeb1fba640b9b9f2eddd88c054d05b37815afd888d
parent00def639882747aad89dfd095ea95f295ad034d3
staging: r8188eu: add kfree() on an error path of rtw_xmit_resource_alloc()

In rtw_xmit_resource_alloc(), if usb_alloc_urb() fails, then the memory
`pxmitbuf->pallocated_buf` which is allocated by kzalloc() is not properly
released before returning.
So this patch adds kfree() on the above error path to release it in time.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_3B46EE3287288555389AD2EC3F388827B306@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_xmit.c