From: Mathias Nyman Date: Mon, 11 Dec 2017 08:38:03 +0000 (+0200) Subject: xhci: fixup incorrect memset size parameter when clearing up DbC on exit. X-Git-Tag: v4.19~1693^2~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33369d5a20549ac371f1f20f389f58246acc7621;p=platform%2Fkernel%2Flinux-rpi.git 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 --- diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 671e502..452df0f 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)