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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210416083449.72700-4-efremov@linux.com>
Date:   Fri, 16 Apr 2021 11:34:47 +0300
From:   Denis Efremov <efremov@...ux.com>
To:     linux-block@...r.kernel.org
Cc:     Denis Efremov <efremov@...ux.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 3/5] floppy: cleanups: use memset() to zero reply_buffer

Use memset() to zero reply buffer in raw_cmd_copyin() instead
of a for loop.

Signed-off-by: Denis Efremov <efremov@...ux.com>
---
 drivers/block/floppy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index df5c32900539..c58b0b079afc 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3090,7 +3090,6 @@ static int raw_cmd_copyin(int cmd, void __user *param,
 {
 	struct floppy_raw_cmd *ptr;
 	int ret;
-	int i;
 
 	*rcmd = NULL;
 
@@ -3109,8 +3108,7 @@ static int raw_cmd_copyin(int cmd, void __user *param,
 	if (ptr->cmd_count > FD_RAW_CMD_FULLSIZE)
 		return -EINVAL;
 
-	for (i = 0; i < FD_RAW_REPLY_SIZE; i++)
-		ptr->reply[i] = 0;
+	memset(ptr->reply, 0, FD_RAW_REPLY_SIZE);
 	ptr->resultcode = 0;
 
 	if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) {
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ