]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs/squashfs/file_direct.c: replace count*size kmalloc by kmalloc_array
authorFabian Frederick <fabf@skynet.be>
Thu, 26 Jun 2014 00:42:21 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:21 +0000 (10:42 +1000)
kmalloc_array() manages count*sizeof overflow.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Phillip Lougher <phillip@squashfs.org.uk>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/squashfs/file_direct.c

index 62a0de6632e1aa3c8de599e19db3f8d7e2a383e2..43e7a7eddac03cf7ca659cd891ca219bf702aade 100644 (file)
@@ -44,7 +44,7 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize)
 
        pages = end_index - start_index + 1;
 
-       page = kmalloc(sizeof(void *) * pages, GFP_KERNEL);
+       page = kmalloc_array(pages, sizeof(void *), GFP_KERNEL);
        if (page == NULL)
                return res;