All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/blkback: do not leak mode property
@ 2012-12-03 19:32 Olaf Hering
  2012-12-04 10:30 ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2012-12-03 19:32 UTC (permalink / raw)
  To: konrad.wilk; +Cc: linux-kernel, xen-devel, jbeulich, Olaf Hering

be->mode is obtained from xenbus_read, which does a kmalloc for the
message body. The short string is never released, so do it on blkbk
remove.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---

!! Not compile tested !!

 drivers/block/xen-blkback/xenbus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f58434c..a6585a4 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -366,6 +366,7 @@ static int xen_blkbk_remove(struct xenbus_device *dev)
 		be->blkif = NULL;
 	}
 
+	kfree(be->mode);
 	kfree(be);
 	dev_set_drvdata(&dev->dev, NULL);
 	return 0;
-- 
1.8.0.1


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

end of thread, other threads:[~2012-12-05  8:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-03 19:32 [PATCH] xen/blkback: do not leak mode property Olaf Hering
2012-12-04 10:30 ` Jan Beulich
2012-12-04 18:21   ` Olaf Hering
2012-12-05  8:00     ` Jan Beulich

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.