Skip to content

Commit 36cc7e0

Browse files
Haoxiang Ligregkh
authored andcommitted
usb: renesas_usbhs: Fix a resource leak in usbhs_pipe_malloc()
usbhsp_get_pipe() set pipe's flags to IS_USED. In error paths, usbhsp_put_pipe() is required to clear pipe's flags to prevent pipe exhaustion. Fixes: f1407d5 ("usb: renesas_usbhs: Add Renesas USBHS common code") Cc: stable <stable@kernel.org> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Link: https://patch.msgid.link/20251204132129.109234-1-haoxiang_li2024@163.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d14cd99 commit 36cc7e0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • drivers/usb/renesas_usbhs

drivers/usb/renesas_usbhs/pipe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,13 @@ struct usbhs_pipe *usbhs_pipe_malloc(struct usbhs_priv *priv,
713713
/* make sure pipe is not busy */
714714
ret = usbhsp_pipe_barrier(pipe);
715715
if (ret < 0) {
716+
usbhsp_put_pipe(pipe);
716717
dev_err(dev, "pipe setup failed %d\n", usbhs_pipe_number(pipe));
717718
return NULL;
718719
}
719720

720721
if (usbhsp_setup_pipecfg(pipe, is_host, dir_in, &pipecfg)) {
722+
usbhsp_put_pipe(pipe);
721723
dev_err(dev, "can't setup pipe\n");
722724
return NULL;
723725
}

0 commit comments

Comments
 (0)