summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimball Murray <kimball.murray@stratus.com>2006-02-02 00:08:59 -0500
committerChris Wright <chrisw@sous-sol.org>2006-02-09 23:20:07 -0800
commitcacb5bd9e9c404b2e33f1d75f18604df34e16fad (patch)
tree09207fca790390c5bc21113fee5e868399a910a5
parente7a9850f9a29508eb9ba7f43e733b01096bc171d (diff)
[PATCH] Input: mousedev - fix memory leak
Input: mousedev - fix memory leak Apparently, "while true; do cat </dev/null >/dev/input/mice; done" causes an OOM in a short amount of time. Funny that nobody noticed, it actually is very easy to trigger just by switching between VT1 and VT7... Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/input/mousedev.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 2d0af44ac4b9..b329f10f970f 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -356,7 +356,7 @@ static void mousedev_free(struct mousedev *mousedev)
kfree(mousedev);
}
-static int mixdev_release(void)
+static void mixdev_release(void)
{
struct input_handle *handle;
@@ -370,8 +370,6 @@ static int mixdev_release(void)
mousedev_free(mousedev);
}
}
-
- return 0;
}
static int mousedev_release(struct inode * inode, struct file * file)
@@ -384,9 +382,8 @@ static int mousedev_release(struct inode * inode, struct file * file)
if (!--list->mousedev->open) {
if (list->mousedev->minor == MOUSEDEV_MIX)
- return mixdev_release();
-
- if (!mousedev_mix.open) {
+ mixdev_release();
+ else if (!mousedev_mix.open) {
if (list->mousedev->exist)
input_close_device(&list->mousedev->handle);
else