public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix mem-leak in sidewinder driver
@ 2006-05-07  2:03 Jesper Juhl
  2006-05-30  3:49 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Juhl @ 2006-05-07  2:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Vojtech Pavlik, Andrew Morton, Jesper Juhl

In sw_connect we leak 'buf' and 'idbuf' when we do not leave via one of 
the fail* labels. This was spotted by the coverity checker.
This patch fixes the memory leak.

Patch is compile tested only due to lack of hardware.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/input/joystick/sidewinder.c |    2 ++
 1 files changed, 2 insertions(+)

--- linux-2.6.17-rc3-git12-orig/drivers/input/joystick/sidewinder.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.17-rc3-git12/drivers/input/joystick/sidewinder.c	2006-05-07 03:57:47.000000000 +0200
@@ -776,6 +776,8 @@ static int sw_connect(struct gameport *g
 			goto fail4;
 	}
 
+	kfree(buf);
+	kfree(idbuf);
 	return 0;
 
  fail4:	input_free_device(sw->dev[i]);



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

end of thread, other threads:[~2006-05-30  3:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-07  2:03 [PATCH] fix mem-leak in sidewinder driver Jesper Juhl
2006-05-30  3:49 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox