Skip to content

Commit 63a9a72

Browse files
salah-trikijmberg-intel
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/aA3_maPlEJzO7wrL@pc [fix subject] Signed-off-by: Johannes Berg <[email protected]>
1 parent 22c64f3 commit 63a9a72

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/wireless/purelifi/plfxlc

1 file changed

+3
-1
lines changed

drivers/net/wireless/purelifi/plfxlc/usb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,10 @@ int plfxlc_usb_wreq_async(struct plfxlc_usb *usb, const u8 *buffer,
503503
(void *)buffer, buffer_len, complete_fn, context);
504504

505505
r = usb_submit_urb(urb, GFP_ATOMIC);
506-
if (r)
506+
if (r) {
507+
usb_free_urb(urb);
507508
dev_err(&udev->dev, "Async write submit failed (%d)\n", r);
509+
}
508510

509511
return r;
510512
}

0 commit comments

Comments
 (0)