Commit 74570d41 authored by Kimball Murray's avatar Kimball Murray Committed by Dmitry Torokhov

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: default avatarPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 5ae08f80
...@@ -356,7 +356,7 @@ static void mousedev_free(struct mousedev *mousedev) ...@@ -356,7 +356,7 @@ static void mousedev_free(struct mousedev *mousedev)
kfree(mousedev); kfree(mousedev);
} }
static int mixdev_release(void) static void mixdev_release(void)
{ {
struct input_handle *handle; struct input_handle *handle;
...@@ -370,8 +370,6 @@ static int mixdev_release(void) ...@@ -370,8 +370,6 @@ static int mixdev_release(void)
mousedev_free(mousedev); mousedev_free(mousedev);
} }
} }
return 0;
} }
static int mousedev_release(struct inode * inode, struct file * file) static int mousedev_release(struct inode * inode, struct file * file)
...@@ -384,9 +382,8 @@ 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->open) {
if (list->mousedev->minor == MOUSEDEV_MIX) if (list->mousedev->minor == MOUSEDEV_MIX)
return mixdev_release(); mixdev_release();
else if (!mousedev_mix.open) {
if (!mousedev_mix.open) {
if (list->mousedev->exist) if (list->mousedev->exist)
input_close_device(&list->mousedev->handle); input_close_device(&list->mousedev->handle);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment