Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usb: dwc2: Fix memory leak in dwc2_hcd_init
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: 856e6e8 ("usb: dwc2: check return value after calling platform_get_resource()") Cc: stable <[email protected]> Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Miaoqian Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information