From: Fabian Frederick Date: Thu, 26 Jun 2014 00:42:21 +0000 (+1000) Subject: fs/squashfs/file_direct.c: replace count*size kmalloc by kmalloc_array X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=233e7d9d3f2a070977f6f3a02c8c53432a20e6d6;p=karo-tx-linux.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 --- 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;