tools/virtio: add kmalloc_array stub
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 25 Jul 2018 13:38:31 +0000 (16:38 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 27 Jul 2018 13:54:40 +0000 (16:54 +0300)
Fixes: 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tools/virtio/linux/kernel.h

index fca8381bbe041315d955f96e7e045d70d1cc89fb..fb22bccfbc8a7f2df651474211b48aa67efdf8f9 100644 (file)
@@ -52,6 +52,11 @@ static inline void *kmalloc(size_t s, gfp_t gfp)
                return __kmalloc_fake;
        return malloc(s);
 }
+static inline void *kmalloc_array(unsigned n, size_t s, gfp_t gfp)
+{
+       return kmalloc(n * s, gfp);
+}
+
 static inline void *kzalloc(size_t s, gfp_t gfp)
 {
        void *p = kmalloc(s, gfp);