From 8a1aff144d37af492034a9a11a8c6ad3b687a441 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 20 Sep 2018 13:01:59 +0300 Subject: 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 Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: David S. Miller --- drivers/vhost/net.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/vhost') 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; -- cgit v1.2.3