mirror-linux/drivers/usb/gadget
Jon Hunter 94fa043a47 usb: gadget: tegra-xudc: Fix crash in vbus_draw
[ Upstream commit 5629d31955 ]

Commit ac82b56bda ("usb: gadget: tegra-xudc: Add vbus_draw support")
populated the vbus_draw callback for the Tegra XUDC driver. The function
tegra_xudc_gadget_vbus_draw(), that was added by this commit, assumes
that the pointer 'curr_usbphy' has been initialised, which is not always
the case because this is only initialised when the USB role is updated.
Fix this crash, by checking that the 'curr_usbphy' is valid before
dereferencing.

Fixes: ac82b56bda ("usb: gadget: tegra-xudc: Add vbus_draw support")
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20230405181854.42355-1-jonathanh@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:03:30 +09:00
..
function scsi: target: Pass in cmd counter to use during cmd setup 2023-05-11 23:03:19 +09:00
legacy usb: gadget: g_webcam: Send color matching descriptor per frame 2023-01-24 07:24:38 +01:00
udc usb: gadget: tegra-xudc: Fix crash in vbus_draw 2023-05-11 23:03:30 +09:00
Kconfig
Makefile
composite.c
config.c
configfs.c usb: gadget: configfs: Restrict symlink creation is UDC already binded 2023-03-10 09:33:35 +01:00
configfs.h
epautoconf.c
functions.c
u_f.c
u_f.h
u_os_desc.h
usbstring.c