Browse Source

fs/adfs/dir_fplus.c: replace count*size kzalloc by kcalloc

kcalloc manages count*sizeof overflow.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fabian Frederick 11 years ago
parent
commit
b16214d43d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      fs/adfs/dir_fplus.c

+ 1 - 1
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)) {
 	if (size > ARRAY_SIZE(dir->bh)) {
 		/* this directory is too big for fixed bh set, must allocate */
 		/* this directory is too big for fixed bh set, must allocate */
 		struct buffer_head **bh_fplus =
 		struct buffer_head **bh_fplus =
-			kzalloc(size * sizeof(struct buffer_head *),
+			kcalloc(size, sizeof(struct buffer_head *),
 				GFP_KERNEL);
 				GFP_KERNEL);
 		if (!bh_fplus) {
 		if (!bh_fplus) {
 			adfs_error(sb, "not enough memory for"
 			adfs_error(sb, "not enough memory for"