netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] vhost_net: add a missing error return
@ 2018-09-20 10:01 Dan Carpenter
  2018-09-20 12:51 ` Michael S. Tsirkin
  2018-09-21  2:29 ` Jason Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-09-20 10:01 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang
  Cc: netdev, kernel-janitors, kvm, virtualization

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>

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-21  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20 10:01 [PATCH net-next] vhost_net: add a missing error return Dan Carpenter
2018-09-20 12:51 ` Michael S. Tsirkin
2018-09-21  2:29 ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).