drivers: usb: dwc_otg: fix reference passing when checking bandwidth
authorJonathan Bell <jonathan@raspberrypi.com>
Tue, 25 Oct 2022 09:50:10 +0000 (10:50 +0100)
committerPhil Elwell <phil@raspberrypi.com>
Thu, 27 Oct 2022 12:37:04 +0000 (13:37 +0100)
commitd3cfdbb75da06a7dd555d0b0d5686e0def37aadb
tree587603a47233d041e7f0c0dc032161d46a9454d0
parent5645d105832c373cbc93da78ad8f4ba8d064a1fd
drivers: usb: dwc_otg: fix reference passing when checking bandwidth

The pointer (struct usb_host_endpoint *)->hcpriv should contain a
reference to dwc_otg_qh_t if the driver has already seen a URB submitted
to this endpoint.

It then checks whether the qh exists and is already in a schedule in
order to decide whether to allocate periodic bandwidth or not. Passing a
pointer to an offset inside of struct usb_host_endpoint instead of just
the pointer means it dereferences bogus addresses.

Rationalise (delete) a variable while we're at it.

See https://github.com/raspberrypi/linux/issues/5189

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c