public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Björn Steinbrink" <B.Steinbrink@gmx.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jiri Kosina <jkosina@suse.cz>
Subject: Re: [PATCH] evdev: Release eventual input device grabs when getting disconnected
Date: Mon, 31 Mar 2008 23:02:46 +0200	[thread overview]
Message-ID: <1206997366.5143.36.camel@johannes.berg> (raw)
In-Reply-To: <20080330184259.GB21375@atjola.homenet> (sfid-20080330_194343_420194_2EBEE846)

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]


> --- a/drivers/input/evdev.c
> +++ b/drivers/input/evdev.c
> @@ -853,6 +853,9 @@ static void evdev_cleanup(struct evdev *evdev)
>  	evdev_hangup(evdev);
>  	evdev_remove_chrdev(evdev);
>  
> +	if (evdev->grab)
> +		evdev_ungrab(evdev, evdev->grab);
> +

You might want to insert a comment about why this is safe and doesn't
race since it's not entirely trivial to see because everything else that
manipulates the grab needs to take the mutex. In fact, I'm not entirely
sure it's race-free but at least it can't race against the ioctl handler
because by this time ->exist will be 0.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      parent reply	other threads:[~2008-04-01 11:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-30 18:42 [PATCH] evdev: Release eventual input device grabs when getting disconnected Björn Steinbrink
2008-03-30 21:51 ` Linus Torvalds
2008-03-30 22:22   ` Greg KH
2008-03-30 22:35     ` Linus Torvalds
2008-03-30 22:42     ` Björn Steinbrink
2008-03-30 23:19       ` Arjan van de Ven
2008-03-31 20:46       ` Dmitry Torokhov
2008-03-31  6:15   ` Dmitry Torokhov
2008-03-31 17:28     ` Greg KH
2008-03-31 18:01       ` Dmitry Torokhov
2008-03-31 18:24         ` Linus Torvalds
2008-03-31 23:12           ` Benjamin Herrenschmidt
2008-03-31 23:51             ` Greg KH
2008-04-01  1:01               ` Benjamin Herrenschmidt
2008-03-31 20:42         ` Greg KH
2008-03-31 20:57           ` Dmitry Torokhov
2008-03-31 22:09             ` Greg KH
2008-04-01  3:30               ` Dmitry Torokhov
2008-03-31 21:27           ` Jiri Kosina
2008-03-31 22:46             ` Kay Sievers
2008-03-31 20:21   ` Johannes Berg
2008-03-31 19:05 ` Björn Steinbrink
2008-04-01 11:51   ` Johannes Berg
2008-04-01 15:20     ` Björn Steinbrink
2008-04-02  9:17       ` Johannes Berg
2008-03-31 21:02 ` Johannes Berg [this message]

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=1206997366.5143.36.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=B.Steinbrink@gmx.de \
    --cc=arjan@linux.intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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