Whamcloud - gitweb
e2fsck/revoke.c: sync kernel's adoption of kmalloc_array()
[tools/e2fsprogs.git] / e2fsck / jfs_user.h
index 239ac1d..1445c3e 100644 (file)
@@ -92,6 +92,13 @@ typedef struct {
 #define kmalloc(len, flags) malloc(len)
 #define kfree(p) free(p)
 
+static inline void *kmalloc_array(unsigned n, unsigned size, int flags)
+{
+       if (n && (~0U)/n < size)
+               return NULL;
+       return malloc(n * size);
+}
+
 #define cond_resched() do { } while (0)
 
 #define __init