All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: Fix leak of BdrvIoctlCompletionData when driver returns NULL
@ 2016-05-31  8:34 Fam Zheng
  2016-05-31  9:14 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Fam Zheng @ 2016-05-31  8:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, Fam Zheng, Kevin Wolf, Max Reitz, qemu-block,
	qemu-stable

"data" allocated in bdrv_co_do_ioctl is not freed. Free it before
returning.

Cc: qemu-stable@nongnu.org
Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/io.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/io.c b/block/io.c
index 2d832aa..aa5a5d7 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2320,6 +2320,7 @@ static void bdrv_ioctl_bh_cb(void *opaque)
 
     bdrv_co_io_em_complete(data->co, -ENOTSUP);
     qemu_bh_delete(data->bh);
+    g_free(data);
 }
 
 static int bdrv_co_do_ioctl(BlockDriverState *bs, int req, void *buf)
-- 
2.8.3

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

end of thread, other threads:[~2016-05-31 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-31  8:34 [Qemu-devel] [PATCH] block: Fix leak of BdrvIoctlCompletionData when driver returns NULL Fam Zheng
2016-05-31  9:14 ` Paolo Bonzini
2016-05-31 10:49   ` Fam Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.