xhci: fixup incorrect memset size parameter when clearing up DbC on exit.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Mon, 11 Dec 2017 08:38:03 +0000 (10:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Dec 2017 12:16:07 +0000 (13:16 +0100)
Incorrect size was given to memset when zeroing the DbC endpoint
structures on exit. Use element size * ARRAY_SIZE to fix it

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-dbgcap.c

index 671e5023e683c8dbcf55604db116065f7c21e6f4..452df0f87d6e55b041918ea11baa5768bcd2a9fb 100644 (file)
@@ -366,7 +366,7 @@ static void xhci_dbc_eps_exit(struct xhci_hcd *xhci)
 {
        struct xhci_dbc         *dbc = xhci->dbc;
 
-       memset(dbc->eps, 0, ARRAY_SIZE(dbc->eps));
+       memset(dbc->eps, 0, sizeof(struct dbc_ep) * ARRAY_SIZE(dbc->eps));
 }
 
 static int xhci_dbc_mem_init(struct xhci_hcd *xhci, gfp_t flags)