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: <20220312172232.13146-1-michaelestner@web.de>
Date:   Sat, 12 Mar 2022 18:22:30 +0100
From:   Michael Estner <michaelestner@....de>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:     kernel-janitor-commits@...r.kernel.org,
        Michael Estner <michaelestner@....de>,
        Johan Hovold <johan@...nel.org>, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] drivers: usbtouchscreen: use kzalloc

Use kzalloc instead of kmalloc + memset.

The semantic patch that makes this change is:
(https://coccinelle.gitlabpages.inria.fr/website/)

Signed-off-by: Michael Estner <michaelestner@....de>
---
 drivers/input/touchscreen/usbtouchscreen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 43c521f50c85..159e1ac6198a 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -975,7 +975,7 @@ static int nexio_init(struct usbtouch_usb *usbtouch)
 	if (!input_ep || !output_ep)
 		return -ENXIO;

-	buf = kmalloc(NEXIO_BUFSIZE, GFP_NOIO);
+	buf = kzalloc(NEXIO_BUFSIZE, GFP_NOIO);
 	if (!buf)
 		goto out_buf;

@@ -998,7 +998,6 @@ static int nexio_init(struct usbtouch_usb *usbtouch)

 	/* read replies */
 	for (i = 0; i < 3; i++) {
-		memset(buf, 0, NEXIO_BUFSIZE);
 		ret = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, input_ep),
 				   buf, NEXIO_BUFSIZE, &actual_len,
 				   NEXIO_TIMEOUT);
--
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ