All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: comedi: fix memory leak
@ 2014-03-14 16:16 Levente Kurusa
  2014-03-15  3:30 ` Chase Southwood
  0 siblings, 1 reply; 4+ messages in thread
From: Levente Kurusa @ 2014-03-14 16:16 UTC (permalink / raw)
  To: Ian Abbott, H Hartley Sweeten
  Cc: Greg Kroah-Hartman, OSUOSL Drivers, LKML, Levente Kurusa

Call kfree() on bdev. The variable is otherwise leaked.

Signed-off-by: Levente Kurusa <levex@linux.com>
---
 drivers/staging/comedi/drivers/comedi_bond.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c
index 51a59e5..406aedb 100644
--- a/drivers/staging/comedi/drivers/comedi_bond.c
+++ b/drivers/staging/comedi/drivers/comedi_bond.c
@@ -254,6 +254,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
 			if (!devs) {
 				dev_err(dev->class_dev,
 					"Could not allocate memory. Out of memory?\n");
+				kfree(bdev);
 				return -ENOMEM;
 			}
 			devpriv->devs = devs;
-- 
1.8.3.1


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

end of thread, other threads:[~2014-03-15  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14 16:16 [PATCH] staging: comedi: fix memory leak Levente Kurusa
2014-03-15  3:30 ` Chase Southwood
2014-03-15  6:55   ` Levente Kurusa
2014-03-15  7:21     ` Chase Southwood

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.