From: Fabian Frederick Date: Fri, 8 Aug 2014 21:22:41 +0000 (-0700) Subject: fs/omfs/inode.c: replace count*size kzalloc by kcalloc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=998d6688fb399ab313dcd6f24d1196e3aaa8578c;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git fs/omfs/inode.c: replace count*size kzalloc by kcalloc kcalloc manages count*sizeof overflow. Signed-off-by: Fabian Frederick Acked-by: Bob Copeland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index ec58c7659183..ba8819702c56 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;