public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: linux-kernel@vger.kernel.org
Cc: emard@softhome.net
Subject: Re: [PATCH] uinput crash maybe this is the FIX
Date: Mon, 17 Oct 2005 00:55:47 -0500	[thread overview]
Message-ID: <200510170055.47342.dtor_core@ameritech.net> (raw)
In-Reply-To: <20051016220606.GA30260@tink>

On Sunday 16 October 2005 17:06, emard@softhome.net wrote:
> HI
> 
> THanks for all the hints.
> 
> Here's my fix for the situation in the uinput.
> It generally breaks when Force feedback is removed,
> sometimes request id slot is not freed correctly and
> it can lead to crash and/or running out of slots.
> 
> Without knowing much what I'm doing, I added one
> lock and it seems to fix the problem.
>

The lock is not really needed, please try the patch below.

-- 
Dmitry

Input: 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>
---

 drivers/input/misc/uinput.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: work/drivers/input/misc/uinput.c
===================================================================
--- work.orig/drivers/input/misc/uinput.c
+++ work/drivers/input/misc/uinput.c
@@ -90,11 +90,11 @@ static inline int uinput_request_reserve
 
 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)

  reply	other threads:[~2005-10-17  5:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-15 21:29 uinput crash and fix emard
2005-10-15 22:01 ` Mattia Dongili
2005-10-15 22:48   ` Mattia Dongili
2005-10-15 22:51 ` emard
2005-10-16 11:51   ` uinput crash and NO FIX YET emard
2005-10-16 21:12     ` emard
2005-10-16 22:06       ` [PATCH] uinput crash maybe this is the FIX emard
2005-10-17  5:55         ` Dmitry Torokhov [this message]
2005-10-17  7:16           ` emard
2005-10-17 21:28             ` Let this uinput patch go to 2.6.14 emard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200510170055.47342.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=emard@softhome.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox