From: Dmitry Torokhov Date: Mon, 17 Oct 2005 23:43:32 +0000 (-0700) Subject: [PATCH] uniput - fix crash on SMP X-Git-Tag: v2.6.14-rc5~23 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e7507ed91e093b9e4e218e41ebfdce05458258fc;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index d5c5b32045a..4015a91f4b6 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -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)