wifi: zd1211rw: fix potential memory leak in __zd_usb_enable_rx()

The memory allocated for urbs with kcalloc() is not freed on any error
path. Fix that by freeing it in the error path.

Fixes: e85d0918b5 ("[PATCH] ZyDAS ZD1211 USB-WLAN driver")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Link: https://patch.msgid.link/20251028174341.139134-1-nihaal@cse.iitm.ac.in
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Abdun Nihaal 2025-10-28 23:13:39 +05:30 committed by Johannes Berg
parent fbc1cc6973
commit 70e8335485

View File

@ -791,6 +791,7 @@ static int __zd_usb_enable_rx(struct zd_usb *usb)
if (urbs) {
for (i = 0; i < RX_URBS_COUNT; i++)
free_rx_urb(urbs[i]);
kfree(urbs);
}
return r;
}