Skip to content

Commit

Permalink
[PATCH] uniput - fix crash on SMP
Browse files Browse the repository at this point in the history
Only signal completion after marking request slot as free, otherwise other
processor can free request structure before we finish using it.

Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dmitry Torokhov authored and Linus Torvalds committed Oct 18, 2005
1 parent 5cc9eee commit e7507ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/input/misc/uinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ static inline int uinput_request_reserve_slot(struct uinput_device *udev, struct

static void uinput_request_done(struct uinput_device *udev, struct uinput_request *request)
{
complete(&request->done);

/* Mark slot as available */
udev->requests[request->id] = NULL;
wake_up_interruptible(&udev->requests_waitq);

complete(&request->done);
}

static int uinput_request_submit(struct input_dev *dev, struct uinput_request *request)
Expand Down

0 comments on commit e7507ed

Please sign in to comment.