Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: f1407d5c6624 ("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>

authored by

Haoxiang Li and committed by
Greg Kroah-Hartman
36cc7e09 d14cd998

+2
+2
drivers/usb/renesas_usbhs/pipe.c
··· 713 713 /* make sure pipe is not busy */ 714 714 ret = usbhsp_pipe_barrier(pipe); 715 715 if (ret < 0) { 716 + usbhsp_put_pipe(pipe); 716 717 dev_err(dev, "pipe setup failed %d\n", usbhs_pipe_number(pipe)); 717 718 return NULL; 718 719 } 719 720 720 721 if (usbhsp_setup_pipecfg(pipe, is_host, dir_in, &pipecfg)) { 722 + usbhsp_put_pipe(pipe); 721 723 dev_err(dev, "can't setup pipe\n"); 722 724 return NULL; 723 725 }