/[linux-patches]/genpatches-2.6/trunk/2.6.14/1420_15.4_mousedev-leak.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1420_15.4_mousedev-leak.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (hide annotations) (download) (as text)
Tue Mar 14 13:34:17 2006 UTC (14 years, 8 months ago) by johnm
File MIME type: text/x-diff
File size: 1614 byte(s)
2.6.14-11, rebase against local tree
1 johnm 328 Re-diffed for 2.6.14.7 by Kerin Millar <kerframil@gmail.com>:
2    
3     From stable-bounces@linux.kernel.org Wed Feb 1 21:18:54 2006
4     Date: Thu, 02 Feb 2006 00:08:59 -0500
5     From: Dmitry Torokhov <dtor_core@ameritech.net>
6     To: stable@kernel.org
7     Cc:
8     Subject: Input: mousedev - fix memory leak
9    
10     From: Kimball Murray <kimball.murray@stratus.com>
11    
12     Input: mousedev - fix memory leak
13    
14     Apparently, "while true; do cat </dev/null >/dev/input/mice; done" causes
15     an OOM in a short amount of time. Funny that nobody noticed, it actually
16     is very easy to trigger just by switching between VT1 and VT7...
17    
18     Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
19     Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
20     Signed-off-by: Chris Wright <chrisw@sous-sol.org>
21     ---
22    
23     --- linux-2.6.14.7.orig/drivers/input/mousedev.c 2005-10-27 19:02:08.000000000 -0500
24     +++ linux-2.6.14.7/drivers/input/mousedev.c 2006-02-06 20:12:43.000000000 -0500
25     @@ -357,7 +357,7 @@ static void mousedev_free(struct mousede
26     kfree(mousedev);
27     }
28    
29     -static int mixdev_release(void)
30     +static void mixdev_release(void)
31     {
32     struct input_handle *handle;
33    
34     @@ -371,8 +371,6 @@ static int mixdev_release(void)
35     mousedev_free(mousedev);
36     }
37     }
38     -
39     - return 0;
40     }
41    
42     static int mousedev_release(struct inode * inode, struct file * file)
43     @@ -385,9 +383,8 @@ static int mousedev_release(struct inode
44    
45     if (!--list->mousedev->open) {
46     if (list->mousedev->minor == MOUSEDEV_MIX)
47     - return mixdev_release();
48     -
49     - if (!mousedev_mix.open) {
50     + mixdev_release();
51     + else if (!mousedev_mix.open) {
52     if (list->mousedev->exist)
53     input_close_device(&list->mousedev->handle);
54     else

  ViewVC Help
Powered by ViewVC 1.1.20