Commit 8a1aff14 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

vhost_net: add a missing error return

We accidentally left out this error return so it leads to some use after
free bugs later on.

Fixes: 0a0be13b ("vhost_net: batch submitting XDP buffers to underlayer sockets")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ba2a720
...@@ -1244,6 +1244,7 @@ static int vhost_net_open(struct inode *inode, struct file *f) ...@@ -1244,6 +1244,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
kfree(vqs); kfree(vqs);
kvfree(n); kvfree(n);
kfree(queue); kfree(queue);
return -ENOMEM;
} }
n->vqs[VHOST_NET_VQ_TX].xdp = xdp; n->vqs[VHOST_NET_VQ_TX].xdp = xdp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment