From: Fabian Frederick Date: Fri, 8 Aug 2014 21:22:24 +0000 (-0700) Subject: fs/adfs/dir_fplus.c: replace count*size kzalloc by kcalloc X-Git-Tag: firefly_0821_release~176^2~3441^2~106 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b16214d43d9060722360360f741416660b54c4f5;p=firefly-linux-kernel-4.4.55.git fs/adfs/dir_fplus.c: replace count*size kzalloc by kcalloc kcalloc manages count*sizeof overflow. Signed-off-by: Fabian Frederick Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/adfs/dir_fplus.c b/fs/adfs/dir_fplus.c index 7673c1fdbfc0..c52f1ce15f1e 100644 --- a/fs/adfs/dir_fplus.c +++ b/fs/adfs/dir_fplus.c @@ -58,7 +58,7 @@ adfs_fplus_read(struct super_block *sb, unsigned int id, unsigned int sz, struct if (size > ARRAY_SIZE(dir->bh)) { /* this directory is too big for fixed bh set, must allocate */ struct buffer_head **bh_fplus = - kzalloc(size * sizeof(struct buffer_head *), + kcalloc(size, sizeof(struct buffer_head *), GFP_KERNEL); if (!bh_fplus) { adfs_error(sb, "not enough memory for"