public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] fs/omfs/inode.c: replace count*size kzalloc by kcalloc
@ 2014-06-25 18:17 Fabian Frederick
  2014-06-25 18:27 ` Linus Torvalds
  2014-06-25 19:05 ` Bob Copeland
  0 siblings, 2 replies; 6+ messages in thread
From: Fabian Frederick @ 2014-06-25 18:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fabian Frederick, Bob Copeland, Andrew Morton

kcalloc manages count*sizeof overflow.

Cc: Bob Copeland <me@bobcopeland.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/omfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index ec58c76..ba88197 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -321,7 +321,7 @@ static int omfs_get_imap(struct super_block *sb)
 		goto out;
 
 	sbi->s_imap_size = array_size;
-	sbi->s_imap = kzalloc(array_size * sizeof(unsigned long *), GFP_KERNEL);
+	sbi->s_imap = kcalloc(array_size, sizeof(unsigned long *), GFP_KERNEL);
 	if (!sbi->s_imap)
 		goto nomem;
 
-- 
1.9.1


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

end of thread, other threads:[~2014-06-25 20:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25 18:17 [PATCH 1/1] fs/omfs/inode.c: replace count*size kzalloc by kcalloc Fabian Frederick
2014-06-25 18:27 ` Linus Torvalds
2014-06-25 19:02   ` Bob Copeland
2014-06-25 20:03     ` Fabian Frederick
2014-06-25 20:28       ` Bob Copeland
2014-06-25 19:05 ` Bob Copeland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox