Skip to contentSkip to conversation

watch_queue: fix mistake in kcalloc

PATCH New Xu Jia 1 participant 1 message Apr 22, 2022

lore
Share & tools
lore

Xu Jia

author
#0 lore raw

PATCH 1/1 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.

---
 kernel/watch_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/watch_queue.c +1 -1
index 230038d4f908..868ce7e94cf6 100644
@@ -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;
 
Signature · 1 line
2.25.1