wireless: purelifi: plfxlc: fix memory leak in plfxlc_usb_wreq_asyn()

Add usb_free_urb() in the error path to prevent memory leak.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
Link: https://patch.msgid.link/aA3_maPlEJzO7wrL@pc
[fix subject]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Salah Triki 2025-04-27 10:57:45 +01:00 committed by Johannes Berg
parent 22c64f37e1
commit 63a9a727d3

View File

@ -503,8 +503,10 @@ int plfxlc_usb_wreq_async(struct plfxlc_usb *usb, const u8 *buffer,
(void *)buffer, buffer_len, complete_fn, context);
r = usb_submit_urb(urb, GFP_ATOMIC);
if (r)
if (r) {
usb_free_urb(urb);
dev_err(&udev->dev, "Async write submit failed (%d)\n", r);
}
return r;
}