compat: declare kmalloc_array() through LINUX_BACKPORT()
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 28 Mar 2013 02:20:32 +0000 (19:20 -0700)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 28 Mar 2013 06:26:01 +0000 (23:26 -0700)
This fixes compilation with Debian 3.2 kernels that
cherry picked the commit that added that call (a8203725).

commit a8203725dfded5c1f79dca3368a4a273e24b59bb
Author: Xi Wang <xi.wang@gmail.com>
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 <akpm@linux-foundation.org>
Suggested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
include/linux/compat-3.4.h

index 94d3bf718c449dfc40d6f708d21d3c0d7420a018..2cd64a1c18014570bb3e237251977cee00a5b41c 100644 (file)
@@ -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 <linux/compat-3.5.h>
+#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)