diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2018-07-25 16:38:31 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-07-27 16:54:40 +0300 |
commit | f2467ee0698e0fb98d94ed3f11d3e0c19c4228d4 (patch) | |
tree | 1b857222131761a981269dc08f0184397484fd64 | |
parent | 8129e2a1cb39bf0df12cc13c9dc7bb581296bd7b (diff) | |
download | linux-f2467ee0698e0fb98d94ed3f11d3e0c19c4228d4.tar.xz |
tools/virtio: add kmalloc_array stub
Fixes: 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | tools/virtio/linux/kernel.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index fca8381bbe04..fb22bccfbc8a 100644 --- a/tools/virtio/linux/kernel.h +++ b/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); |