All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] fs/exofs/ore_raid.c: replace count*size kzalloc by kcalloc
@ 2014-06-25 18:14 Fabian Frederick
  2014-07-13 10:01 ` Boaz Harrosh
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2014-06-25 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fabian Frederick, Boaz Harrosh, osd-dev, Andrew Morton

kcalloc manages count*sizeof overflow.

Cc: Boaz Harrosh <bharrosh@panasas.com>
Cc: osd-dev@open-osd.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/exofs/ore_raid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c
index 7f20f25..84529b8 100644
--- a/fs/exofs/ore_raid.c
+++ b/fs/exofs/ore_raid.c
@@ -116,7 +116,7 @@ static int _sp2d_alloc(unsigned pages_in_unit, unsigned group_width,
 			num_a1pa = min_t(unsigned, PAGE_SIZE / sizeof__a1pa,
 							pages_in_unit - i);
 
-			__a1pa = kzalloc(num_a1pa * sizeof__a1pa, GFP_KERNEL);
+			__a1pa = kcalloc(num_a1pa, sizeof__a1pa, GFP_KERNEL);
 			if (unlikely(!__a1pa)) {
 				ORE_DBGMSG("!! Failed to _alloc_1p_arrays=%d\n",
 					   num_a1pa);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-13 10:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25 18:14 [PATCH 1/1] fs/exofs/ore_raid.c: replace count*size kzalloc by kcalloc Fabian Frederick
2014-07-13 10:01 ` Boaz Harrosh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.