From 33369d5a20549ac371f1f20f389f58246acc7621 Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Mon, 11 Dec 2017 10:38:03 +0200 Subject: xhci: fixup incorrect memset size parameter when clearing up DbC on exit. 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 Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver") Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-dbgcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/host/xhci-dbgcap.c') diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 671e5023e683..452df0f87d6e 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -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) -- cgit v1.2.3