Skip to content

Commit

Permalink
mm-mempool-do-not-allow-atomic-resizing-checkpatch-fixes
Browse files Browse the repository at this point in the history
WARNING: Prefer kmalloc_array over kmalloc with multiply
torvalds#111: FILE: mm/mempool.c:149:
+	new_elements = kmalloc(new_min_nr * sizeof(*new_elements), GFP_KERNEL);

total: 0 errors, 1 warnings, 81 lines checked

./patches/mm-mempool-do-not-allow-atomic-resizing.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: David Rientjes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
akpm00 authored and sfrothwell committed Apr 7, 2015
1 parent 79d59db commit 630bbfe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ int mempool_resize(mempool_t *pool, int new_min_nr)
spin_unlock_irqrestore(&pool->lock, flags);

/* Grow the pool */
new_elements = kmalloc(new_min_nr * sizeof(*new_elements), GFP_KERNEL);
new_elements = kmalloc_array(new_min_nr, sizeof(*new_elements),
GFP_KERNEL);
if (!new_elements)
return -ENOMEM;

Expand Down

0 comments on commit 630bbfe

Please sign in to comment.