]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
fs/adfs/dir_fplus.c: replace count*size kzalloc by kcalloc
authorFabian Frederick <fabf@skynet.be>
Fri, 8 Aug 2014 21:22:24 +0000 (14:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Aug 2014 22:57:24 +0000 (15:57 -0700)
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>
fs/adfs/dir_fplus.c

index 7673c1fdbfc090e3c715b99a48baeba234ed4a92..c52f1ce15f1eebf5048bff266e21e2b132089019 100644 (file)
@@ -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"