From: Fabian Frederick Date: Wed, 6 Aug 2014 23:03:50 +0000 (-0700) Subject: fs/squashfs/file_direct.c: replace count*size kmalloc by kmalloc_array X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=14694888db2c1f7ba1f2e6172df45813b4db7880;p=openwrt%2Fstaging%2Fblogic.git fs/squashfs/file_direct.c: replace count*size kmalloc by kmalloc_array kmalloc_array() manages count*sizeof overflow. Signed-off-by: Fabian Frederick Cc: Phillip Lougher Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/squashfs/file_direct.c b/fs/squashfs/file_direct.c index 62a0de6632e1..43e7a7eddac0 100644 --- a/fs/squashfs/file_direct.c +++ b/fs/squashfs/file_direct.c @@ -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;