lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171211112806.3415781-1-arnd@arndb.de>
Date:   Mon, 11 Dec 2017 12:27:45 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Mathias Nyman <mathias.nyman@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Arnd Bergmann <arnd@...db.de>, Lu Baolu <baolu.lu@...ux.intel.com>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] usb: xhci: fix incorrect memset()

gcc-8 warnings about the new driver using a memset with a bogus length:

drivers/usb/host/xhci-dbgcap.c: In function 'xhci_dbc_eps_exit':
drivers/usb/host/xhci-dbgcap.c:369:2: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]

It looks like the author meant to use sizeof() rather than ARRAY_SIZE()
here, so use that.

Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/usb/host/xhci-dbgcap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c
index 671e5023e683..1e535bd2be01 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(dbc->eps));
 }
 
 static int xhci_dbc_mem_init(struct xhci_hcd *xhci, gfp_t flags)
-- 
2.9.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ