From: Randy Dunlap Date: Sat, 20 Dec 2025 05:45:41 +0000 (-0800) Subject: kfifo: fix kmalloc_array_node() argument order X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c243413740b39b0cf0a88732de5efc2b45716d81;p=thirdparty%2Fkernel%2Flinux.git kfifo: fix kmalloc_array_node() argument order To be consistent, pass the kmalloc_array_node() parameters in the order (number_of_elements, element_size). Since only the product of the two values is used, this is not a bug fix. Link: https://lkml.kernel.org/r/20251220054541.2295599-1-rdunlap@infradead.org Closes: https://bugzilla.kernel.org/show_bug.cgi?id=216015 Signed-off-by: Randy Dunlap Cc: Stefani Seibold Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- diff --git a/lib/kfifo.c b/lib/kfifo.c index 525e66f8294c8..2633f9cc336cc 100644 --- a/lib/kfifo.c +++ b/lib/kfifo.c @@ -41,7 +41,7 @@ int __kfifo_alloc_node(struct __kfifo *fifo, unsigned int size, return -EINVAL; } - fifo->data = kmalloc_array_node(esize, size, gfp_mask, node); + fifo->data = kmalloc_array_node(size, esize, gfp_mask, node); if (!fifo->data) { fifo->mask = 0;