Skip to content

Commit

Permalink
tools/virtio: add kmalloc_array stub
Browse files Browse the repository at this point in the history
Fixes: 6da2ec5 ("treewide: kmalloc() -> kmalloc_array()")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
mstsirkin committed Jul 27, 2018
1 parent 8129e2a commit f2467ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/virtio/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f2467ee

Please sign in to comment.