Browse Source

tools/virtio: add kmalloc_array stub

Fixes: 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Michael S. Tsirkin 7 years ago
parent
commit
f2467ee069
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tools/virtio/linux/kernel.h

+ 5 - 0
tools/virtio/linux/kernel.h

@@ -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);