aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKimball Murray <kimball.murray@stratus.com>2006-01-29 21:50:59 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-01-29 21:50:59 -0500
commit74570d413cbb5cede06a0183a91d3006f134bf6b (patch)
treeaef81bc8688bcc932019a7a380958de698c3d85b
parent5ae08f80ec5b2b08dd2f76a166140dd156fb31a1 (diff)
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>
-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 81fd7a97a93d..9abed18d2ecf 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -356,7 +356,7 @@ static void mousedev_free(struct mousedev *mousedev)
356 kfree(mousedev); 356 kfree(mousedev);
357} 357}
358 358
359static int mixdev_release(void) 359static void mixdev_release(void)
360{ 360{
361 struct input_handle *handle; 361 struct input_handle *handle;
362 362
@@ -370,8 +370,6 @@ static int mixdev_release(void)
370 mousedev_free(mousedev); 370 mousedev_free(mousedev);
371 } 371 }
372 } 372 }
373
374 return 0;
375} 373}
376 374
377static int mousedev_release(struct inode * inode, struct file * file) 375static int mousedev_release(struct inode * inode, struct file * file)
@@ -384,9 +382,8 @@ static int mousedev_release(struct inode * inode, struct file * file)
384 382
385 if (!--list->mousedev->open) { 383 if (!--list->mousedev->open) {
386 if (list->mousedev->minor == MOUSEDEV_MIX) 384 if (list->mousedev->minor == MOUSEDEV_MIX)
387 return mixdev_release(); 385 mixdev_release();
388 386 else if (!mousedev_mix.open) {
389 if (!mousedev_mix.open) {
390 if (list->mousedev->exist) 387 if (list->mousedev->exist)
391 input_close_device(&list->mousedev->handle); 388 input_close_device(&list->mousedev->handle);
392 else 389 else