aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-11-20 00:51:43 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2005-11-20 00:51:43 -0500
commite597f0c80de7e2ef840b28d111ec532988abc432 (patch)
tree2d8c36d705c27dd081cbd7a6907257d3ad43c8e0 /drivers/input
parent59c7c0377e00a3cbd7b71631177fb92166ceb437 (diff)
Input: uinput - don't use "interruptible" in FF code
If thread that submitted FF request gets interrupted somehow it will release request structure and ioctl handler will work with freed memory. TO prevent that from happening switch to using wait_for_completion instead of wait_for_completion_interruptible. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/uinput.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 4702ade804ac..546ed9b4901d 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -92,24 +92,19 @@ static void uinput_request_done(struct uinput_device *udev, struct uinput_reques
92{ 92{
93 /* Mark slot as available */ 93 /* Mark slot as available */
94 udev->requests[request->id] = NULL; 94 udev->requests[request->id] = NULL;
95 wake_up_interruptible(&udev->requests_waitq); 95 wake_up(&udev->requests_waitq);
96 96
97 complete(&request->done); 97 complete(&request->done);
98} 98}
99 99
100static int uinput_request_submit(struct input_dev *dev, struct uinput_request *request) 100static int uinput_request_submit(struct input_dev *dev, struct uinput_request *request)
101{ 101{
102 int retval;
103
104 /* Tell our userspace app about this new request by queueing an input event */ 102 /* Tell our userspace app about this new request by queueing an input event */
105 uinput_dev_event(dev, EV_UINPUT, request->code, request->id); 103 uinput_dev_event(dev, EV_UINPUT, request->code, request->id);
106 104
107 /* Wait for the request to complete */ 105 /* Wait for the request to complete */
108 retval = wait_for_completion_interruptible(&request->done); 106 wait_for_completion(&request->done);
109 if (!retval) 107 return request->retval;
110 retval = request->retval;
111
112 return retval;
113} 108}
114 109
115static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *effect) 110static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *effect)