diff options
author | Romain Francoise <romain@orebokech.com> | 2014-06-12 04:42:34 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-23 02:22:48 -0400 |
commit | d04257b07f2362d4eb550952d5bf5f4241a8046d (patch) | |
tree | 05b4960991565b585cb45b707935d36c48bffe6b /drivers/vhost/net.c | |
parent | a497c3ba1d97fc69c1e78e7b96435ba8c2cb42ee (diff) |
vhost-net: don't open-code kvfree
Commit 23cc5a991c ("vhost-net: extend device allocation to vmalloc")
added another open-coded version of kvfree (which is available since
v3.15-rc5), nuke it.
Signed-off-by: Romain Francoise <romain@orebokech.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r-- | drivers/vhost/net.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 971a760af4a1..8dae2f724a35 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -700,14 +700,6 @@ static void handle_rx_net(struct vhost_work *work) | |||
700 | handle_rx(net); | 700 | handle_rx(net); |
701 | } | 701 | } |
702 | 702 | ||
703 | static void vhost_net_free(void *addr) | ||
704 | { | ||
705 | if (is_vmalloc_addr(addr)) | ||
706 | vfree(addr); | ||
707 | else | ||
708 | kfree(addr); | ||
709 | } | ||
710 | |||
711 | static int vhost_net_open(struct inode *inode, struct file *f) | 703 | static int vhost_net_open(struct inode *inode, struct file *f) |
712 | { | 704 | { |
713 | struct vhost_net *n; | 705 | struct vhost_net *n; |
@@ -723,7 +715,7 @@ static int vhost_net_open(struct inode *inode, struct file *f) | |||
723 | } | 715 | } |
724 | vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL); | 716 | vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL); |
725 | if (!vqs) { | 717 | if (!vqs) { |
726 | vhost_net_free(n); | 718 | kvfree(n); |
727 | return -ENOMEM; | 719 | return -ENOMEM; |
728 | } | 720 | } |
729 | 721 | ||
@@ -840,7 +832,7 @@ static int vhost_net_release(struct inode *inode, struct file *f) | |||
840 | * since jobs can re-queue themselves. */ | 832 | * since jobs can re-queue themselves. */ |
841 | vhost_net_flush(n); | 833 | vhost_net_flush(n); |
842 | kfree(n->dev.vqs); | 834 | kfree(n->dev.vqs); |
843 | vhost_net_free(n); | 835 | kvfree(n); |
844 | return 0; | 836 | return 0; |
845 | } | 837 | } |
846 | 838 | ||