From: Oliver Neukum <oliver@neukum.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-usb@vger.kernel.org, linux-input@vger.kernel.org,
Ondrej Zary <linux@rainbow-software.org>,
Jiri Kosina <jkosina@suse.cz>, Daniel Ritz <daniel.ritz@gmx.ch>
Subject: Re: [patch]race between disconnect and open in usbtouchscreen
Date: Fri, 20 Nov 2009 22:49:56 +0100 [thread overview]
Message-ID: <200911202249.56591.oliver@neukum.org> (raw)
In-Reply-To: <20091120212259.GC16447@core.coreip.homeip.net>
Am Freitag, 20. November 2009 22:22:59 schrieb Dmitry Torokhov:
> Hi Oliver,
>
> On Fri, Nov 20, 2009 at 10:13:47PM +0100, Oliver Neukum wrote:
> > Hi,
> >
> > an open() between killing the urb and unregistering the device
> > can lead to IO to a disconnected device.
>
> usbtouch_close() calls usb_kill_urb() so there is no race.
> usb_kill_urb() simply not needed in usbtouch_disconnect().
Then it needs to go.
Signed-off-by: Oliver Neukum <oliver@neukum.org>
Regards
Oliver
--
commit 2705666144b8c898283974efc59fd5182e13e652
Author: Oliver Neukum <oliver@neukum.org>
Date: Fri Nov 20 22:41:04 2009 +0100
usbtouchscreen:remove unneeded usb_kill_urb
usb_kill_urb() in disconnect is not needed as unregistering
cause close to be called
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 68ece58..eddb628 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1087,7 +1087,7 @@ static void usbtouch_disconnect(struct usb_interface *intf)
dbg("%s - usbtouch is initialized, cleaning up", __func__);
usb_set_intfdata(intf, NULL);
- usb_kill_urb(usbtouch->irq);
+ /* this will stop IO via close */
input_unregister_device(usbtouch->input);
usb_free_urb(usbtouch->irq);
usbtouch_free_buffers(interface_to_usbdev(intf), usbtouch);
next prev parent reply other threads:[~2009-11-20 21:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-20 21:13 [patch]race between disconnect and open in usbtouchscreen Oliver Neukum
2009-11-20 21:22 ` Dmitry Torokhov
2009-11-20 21:49 ` Oliver Neukum [this message]
2009-11-23 17:21 ` Dmitry Torokhov
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=200911202249.56591.oliver@neukum.org \
--to=oliver@neukum.org \
--cc=daniel.ritz@gmx.ch \
--cc=dmitry.torokhov@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@rainbow-software.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.