Skip to content

Commit 8e00911

Browse files
committed
Input: uinput - allow FF requests to time out
Previously uinput force feedback requests waited for the userspace indefinitely, which caused users to block when uinput server process become unresponsive. Let's establish a 30 seconds deadline for servicing upload and erase force feedback effect actions, so that users have a chance to abort stuck requests. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 8446b32 commit 8e00911

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎drivers/input/misc/uinput.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ static int uinput_request_submit(struct uinput_device *udev,
149149
if (retval)
150150
goto out;
151151

152-
wait_for_completion(&request->done);
152+
if (!wait_for_completion_timeout(&request->done, 30 * HZ)) {
153+
retval = -ETIMEDOUT;
154+
goto out;
155+
}
156+
153157
retval = request->retval;
154158

155159
out:

0 commit comments

Comments
 (0)