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)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:24 +0000 (11:33 +0000)
commitd618b208e92e1f1e19e7089412a908447a5d2e2e
treec883d10e3487a120952cf4a97ccdb3843e1fd79f
parent2b5e4621935ab54e5d85ad8e071022fae18e16ad
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