提交 d04257b0 编写于 作者: R Romain Francoise 提交者: Michael S. Tsirkin

vhost-net: don't open-code kvfree

Commit 23cc5a99 ("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: NRomain Francoise <romain@orebokech.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 a497c3ba
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册