usb: dwc_otg: remove wrong memory accesses found by kasan
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 17 Jan 2018 01:29:01 +0000 (10:29 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Mon, 6 Jul 2020 09:06:06 +0000 (18:06 +0900)
dwc_otg_hcd_is_bandwidth_allocated() requres ep_hcpriv pointer,
but passed parameter is double pointer and it cuases bad memory
access. Remove the wrong memory accesses.

Change-Id: I8292613f16fbf91ed9736b2a97e4afdb3bbbccec
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c

index eda7a33..46dadc4 100644 (file)
@@ -824,7 +824,7 @@ static int dwc_otg_urb_enqueue(struct usb_hcd *hcd,
        if ((usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS)
            || (usb_pipetype(urb->pipe) == PIPE_INTERRUPT)) {
                if (!dwc_otg_hcd_is_bandwidth_allocated
-                   (dwc_otg_hcd, ref_ep_hcpriv)) {
+                   (dwc_otg_hcd, *ref_ep_hcpriv)) {
                        alloc_bandwidth = 1;
                }
        }