diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2018-07-25 15:38:31 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-07-27 15:54:40 +0200 |
commit | f2467ee0698e0fb98d94ed3f11d3e0c19c4228d4 (patch) | |
tree | 1b857222131761a981269dc08f0184397484fd64 /tools | |
parent | tools/virtio: add dma barrier stubs (diff) | |
download | linux-f2467ee0698e0fb98d94ed3f11d3e0c19c4228d4.tar.xz linux-f2467ee0698e0fb98d94ed3f11d3e0c19c4228d4.zip |
tools/virtio: add kmalloc_array stub
Fixes: 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools')
-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); |