summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorZiyang Xuan <william.xuanziyang@huawei.com>2022-11-19 06:19:00 +0100
committerKalle Valo <kvalo@kernel.org>2022-11-28 14:56:17 +0100
commit895b3b06efc285c1245242e9638b9ae251dc13ec (patch)
tree5201265b68d8bc5e0375be95090a4ed9451727ef /drivers/net/wireless
parentwifi: p54: Replace zero-length array of trailing structs with flex-array (diff)
downloadlinux-895b3b06efc285c1245242e9638b9ae251dc13ec.tar.xz
linux-895b3b06efc285c1245242e9638b9ae251dc13ec.zip
wifi: plfxlc: fix potential memory leak in __lf_x_usb_enable_rx()
urbs does not be freed in exception paths in __lf_x_usb_enable_rx(). That will trigger memory leak. To fix it, add kfree() for urbs within "error" label. Compile tested only. Fixes: 68d57a07bfe5 ("wireless: add plfxlc driver for pureLiFi X, XL, XC devices") Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221119051900.1192401-1-william.xuanziyang@huawei.com
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/purelifi/plfxlc/usb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c
index 39e54b3787d6..76d0a778636a 100644
--- a/drivers/net/wireless/purelifi/plfxlc/usb.c
+++ b/drivers/net/wireless/purelifi/plfxlc/usb.c
@@ -247,6 +247,7 @@ error:
for (i = 0; i < RX_URBS_COUNT; i++)
free_rx_urb(urbs[i]);
}
+ kfree(urbs);
return r;
}