Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:43 +0200
committerJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:53 +0200
commit3782ea2f5222c28705782076347a7a64735055c5 (patch)
treea4ab0aa1a33f89d26ea4393c6c5b13731a72df78
parent879610c1029e077f09f6fd79938a0afb698b43fe (diff)
virtio_ring: Fix potential mem leak in
virtqueue_add_indirect_packed (bnc#1012628). suse-commit: a4ff3f0eed766da2549e0597fc46e9d30231d63a
-rw-r--r--drivers/virtio/virtio_ring.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 5df92c308286..021010424fa5 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1004,6 +1004,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
if (unlikely(vq->vq.num_free < 1)) {
pr_debug("Can't add buf len 1 - avail = 0\n");
+ kfree(desc);
END_USE(vq);
return -ENOSPC;
}