lkml.org 
[lkml]   [2006]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fix mem-leak in sidewinder driver
Date
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]);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-07 04:05    [W:0.046 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site