diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-09-20 12:01:59 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-21 18:05:57 +0200 |
commit | 8a1aff144d37af492034a9a11a8c6ad3b687a441 (patch) | |
tree | 4563d6d1cc6a7644ecf3557fe1f43cdcdb31aadd /drivers/vhost/net.c | |
parent | Merge branch 'kfree_skb-NULL' (diff) | |
download | linux-8a1aff144d37af492034a9a11a8c6ad3b687a441.tar.xz linux-8a1aff144d37af492034a9a11a8c6ad3b687a441.zip |
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: 0a0be13b8fe2 ("vhost_net: batch submitting XDP buffers to underlayer sockets")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r-- | drivers/vhost/net.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index dd4e0a301635..1bff6bc8161a 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1244,6 +1244,7 @@ static int vhost_net_open(struct inode *inode, struct file *f) kfree(vqs); kvfree(n); kfree(queue); + return -ENOMEM; } n->vqs[VHOST_NET_VQ_TX].xdp = xdp; |