aboutsummaryrefslogtreecommitdiffstats
path: root/tools/virtio/linux
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2018-07-25 09:38:31 -0400
committerMichael S. Tsirkin <mst@redhat.com>2018-07-27 09:54:40 -0400
commitf2467ee0698e0fb98d94ed3f11d3e0c19c4228d4 (patch)
tree1b857222131761a981269dc08f0184397484fd64 /tools/virtio/linux
parent8129e2a1cb39bf0df12cc13c9dc7bb581296bd7b (diff)
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/virtio/linux')
-rw-r--r--tools/virtio/linux/kernel.h5
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)
52 return __kmalloc_fake; 52 return __kmalloc_fake;
53 return malloc(s); 53 return malloc(s);
54} 54}
55static inline void *kmalloc_array(unsigned n, size_t s, gfp_t gfp)
56{
57 return kmalloc(n * s, gfp);
58}
59
55static inline void *kzalloc(size_t s, gfp_t gfp) 60static inline void *kzalloc(size_t s, gfp_t gfp)
56{ 61{
57 void *p = kmalloc(s, gfp); 62 void *p = kmalloc(s, gfp);