summaryrefslogtreecommitdiffstats
path: root/drivers/vhost
diff options
context:
space:
mode:
authorRomain Francoise <romain@orebokech.com>2014-06-12 10:42:34 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-06-23 09:22:48 +0300
commitd04257b07f2362d4eb550952d5bf5f4241a8046d (patch)
tree05b4960991565b585cb45b707935d36c48bffe6b /drivers/vhost
parenta497c3ba1d97fc69c1e78e7b96435ba8c2cb42ee (diff)
downloadblackbird-op-linux-d04257b07f2362d4eb550952d5bf5f4241a8046d.tar.gz
blackbird-op-linux-d04257b07f2362d4eb550952d5bf5f4241a8046d.zip
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')
-rw-r--r--drivers/vhost/net.c12
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)
handle_rx(net);
}
-static void vhost_net_free(void *addr)
-{
- if (is_vmalloc_addr(addr))
- vfree(addr);
- else
- kfree(addr);
-}
-
static int vhost_net_open(struct inode *inode, struct file *f)
{
struct vhost_net *n;
@@ -723,7 +715,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
}
vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL);
if (!vqs) {
- vhost_net_free(n);
+ kvfree(n);
return -ENOMEM;
}
@@ -840,7 +832,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
* since jobs can re-queue themselves. */
vhost_net_flush(n);
kfree(n->dev.vqs);
- vhost_net_free(n);
+ kvfree(n);
return 0;
}
OpenPOWER on IntegriCloud