diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-05-30 11:54:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-22 15:28:07 +0300 |
commit | 52bfcedbfd5bf962dbdcb6e761f4d0dd3ba26dfd (patch) | |
tree | e2dda9a696eb4a6fd25074c8e5ea809803e3ecac /drivers/gpio/gpio-palmas.c | |
parent | 9e22858cdef7d1ecce0fa1f444418008e8c10178 (diff) | |
download | linux-52bfcedbfd5bf962dbdcb6e761f4d0dd3ba26dfd.tar.xz |
usb: dwc2: Fix memory leak in dwc2_hcd_init
commit 3755278f078460b021cd0384562977bf2039a57a upstream.
usb_create_hcd will alloc memory for hcd, and we should
call usb_put_hcd to free it when platform_get_resource()
fails to prevent memory leak.
goto error2 label instead error1 to fix this.
Fixes: 856e6e8e0f93 ("usb: dwc2: check return value after calling platform_get_resource()")
Cc: stable <stable@kernel.org>
Acked-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220530085413.44068-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpio/gpio-palmas.c')
0 files changed, 0 insertions, 0 deletions