wireless: purelifi: plfxlc: fix memory leak in plfxlc_usb_wreq_asyn()
[ Upstream commit 63a9a727d373fa5b8ce509eef50dbc45e0f745b9 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
187829fb0c
commit
efa7997ce8
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user