All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] fs/f2fs/segment.c: replace count*size kzalloc by kcalloc
@ 2014-06-23 16:39 ` Fabian Frederick
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Frederick @ 2014-06-23 16:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fabian Frederick, Jaegeuk Kim, linux-f2fs-devel

kcalloc manages count*sizeof overflow.

Cc: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index f25f0e0..96f51d4 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1702,7 +1702,7 @@ static int build_curseg(struct f2fs_sb_info *sbi)
 	struct curseg_info *array;
 	int i;
 
-	array = kzalloc(sizeof(*array) * NR_CURSEG_TYPE, GFP_KERNEL);
+	array = kcalloc(NR_CURSEG_TYPE, sizeof(*array), GFP_KERNEL);
 	if (!array)
 		return -ENOMEM;
 
-- 
1.8.4.5


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

* [PATCH 1/1] fs/f2fs/segment.c: replace count*size kzalloc by kcalloc
@ 2014-06-23 16:39 ` Fabian Frederick
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Frederick @ 2014-06-23 16:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fabian Frederick, linux-f2fs-devel

kcalloc manages count*sizeof overflow.

Cc: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index f25f0e0..96f51d4 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1702,7 +1702,7 @@ static int build_curseg(struct f2fs_sb_info *sbi)
 	struct curseg_info *array;
 	int i;
 
-	array = kzalloc(sizeof(*array) * NR_CURSEG_TYPE, GFP_KERNEL);
+	array = kcalloc(NR_CURSEG_TYPE, sizeof(*array), GFP_KERNEL);
 	if (!array)
 		return -ENOMEM;
 
-- 
1.8.4.5


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems

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

end of thread, other threads:[~2014-06-23 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-23 16:39 [PATCH 1/1] fs/f2fs/segment.c: replace count*size kzalloc by kcalloc Fabian Frederick
2014-06-23 16:39 ` Fabian Frederick

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.