mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] watch_queue: fix mistake in kcalloc
@ 2022-04-22  6:39 Xu Jia
  0 siblings, 0 replies; only message in thread
From: Xu Jia @ 2022-04-22  6:39 UTC (permalink / raw)
  To: linux-kernel, dhowells; +Cc: edumazet, christophe.jaillet

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@huawei.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-22  6:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22  6:39 [PATCH] watch_queue: fix mistake in kcalloc Xu Jia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®