kcalloc manages count*sizeof overflow.

Cc: Bob Copeland <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Fabian Frederick <[email protected]>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to