Skip to contentSkip to conversation

kfifo: fix kmalloc_array_node() argument order

PATCH Applied Randy Dunlap 1 participant 1 message Dec 20, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

---
Cc: Stefani Seibold <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Vlastimil Babka <[email protected]>

---
 lib/kfifo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/kfifo.c +1 -1
@@ -41,7 +41,7 @@ int __kfifo_alloc_node(struct __kfifo *f
 		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;