mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-24 14:54:49 +08:00
usb: gadget: udc: fix NULL dereference in remove()
The "udc" pointer was never set in the probe() function so it will lead to a NULL dereference in udc_pci_remove() when we do: usb_del_gadget_udc(&udc->gadget); Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/ZG+A/dNpFWAlCChk@kili Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
efb6b53520
commit
016da9c65f
@ -170,6 +170,9 @@ static int udc_pci_probe(
|
||||
retval = -ENODEV;
|
||||
goto err_probe;
|
||||
}
|
||||
|
||||
udc = dev;
|
||||
|
||||
return 0;
|
||||
|
||||
err_probe:
|
||||
|
Loading…
Reference in New Issue
Block a user