[PATCH] uniput - fix crash on SMP

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 <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Dmitry Torokhov 2005-10-17 16:43:32 -07:00 committed by Linus Torvalds
parent 5cc9eeef9a
commit e7507ed91e
1 changed files with 2 additions and 2 deletions

View File

@ -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)