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>] [day] [month] [year] [list]
Message-ID: <1650609547-9854-1-git-send-email-xujia39@huawei.com>
Date:   Fri, 22 Apr 2022 14:39:07 +0800
From:   Xu Jia <xujia39@...wei.com>
To:     <linux-kernel@...r.kernel.org>, <dhowells@...hat.com>
CC:     <edumazet@...gle.com>, <christophe.jaillet@...adoo.fr>
Subject: [PATCH] watch_queue: fix mistake in kcalloc

In function watch_queue_set_size, when the func kcalloc is
invoked, the number of elements and the element size are reversed.
It is a cleanup patch and does not affect the implementation.

Signed-off-by: Xu Jia <xujia39@...wei.com>
---
 kernel/watch_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c
index 230038d4f908..868ce7e94cf6 100644
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -248,7 +248,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes)
 	if (ret < 0)
 		goto error;
 
-	pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL);
+	pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL);
 	if (!pages)
 		goto error;
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ