diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-09-20 13:01:59 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-21 09:05:57 -0700 |
commit | 8a1aff144d37af492034a9a11a8c6ad3b687a441 (patch) | |
tree | 4563d6d1cc6a7644ecf3557fe1f43cdcdb31aadd /drivers/vhost/net.c | |
parent | 1ba2a720da72b11435dbe278c6ab83aac75734e5 (diff) | |
download | linux-stable-8a1aff144d37af492034a9a11a8c6ad3b687a441.tar.gz linux-stable-8a1aff144d37af492034a9a11a8c6ad3b687a441.tar.bz2 linux-stable-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; |