From: Luis R. Rodriguez Date: Thu, 28 Mar 2013 02:20:32 +0000 (-0700) Subject: compat: declare kmalloc_array() through LINUX_BACKPORT() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6ae26aae48ab0ba6c06805cba5d3b5acb1455f08;p=openwrt%2Fstaging%2Fblogic.git compat: declare kmalloc_array() through LINUX_BACKPORT() This fixes compilation with Debian 3.2 kernels that cherry picked the commit that added that call (a8203725). commit a8203725dfded5c1f79dca3368a4a273e24b59bb Author: Xi Wang Date: Mon Mar 5 15:14:41 2012 -0800 slab: introduce kmalloc_array() Introduce a kmalloc_array() wrapper that performs integer overflow checking without zeroing the memory. Suggested-by: Andrew Morton Suggested-by: Jens Axboe Signed-off-by: Xi Wang Cc: Dan Carpenter Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Pekka Enberg Signed-off-by: Luis R. Rodriguez --- diff --git a/include/linux/compat-3.4.h b/include/linux/compat-3.4.h index 94d3bf718c44..2cd64a1c1801 100644 --- a/include/linux/compat-3.4.h +++ b/include/linux/compat-3.4.h @@ -40,6 +40,7 @@ extern void compat_wake_up_locked(wait_queue_head_t *q, unsigned int mode, int n /* SIZE_MAX is backported in compat-3.5.h so include it */ #include +#define kmalloc_array LINUX_BACKPORT(kmalloc_array) static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) { if (size != 0 && n > SIZE_MAX / size)