mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
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>
This commit is contained in:
parent
a497c3ba1d
commit
d04257b07f
1 changed files with 2 additions and 10 deletions
|
@ -700,14 +700,6 @@ static void handle_rx_net(struct vhost_work *work)
|
||||||
handle_rx(net);
|
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)
|
static int vhost_net_open(struct inode *inode, struct file *f)
|
||||||
{
|
{
|
||||||
struct vhost_net *n;
|
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);
|
vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL);
|
||||||
if (!vqs) {
|
if (!vqs) {
|
||||||
vhost_net_free(n);
|
kvfree(n);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -840,7 +832,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
|
||||||
* since jobs can re-queue themselves. */
|
* since jobs can re-queue themselves. */
|
||||||
vhost_net_flush(n);
|
vhost_net_flush(n);
|
||||||
kfree(n->dev.vqs);
|
kfree(n->dev.vqs);
|
||||||
vhost_net_free(n);
|
kvfree(n);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue