Re: [PATCH 0/2] Provide a driver for the Apple Magic Mouse - opps

From
Jiri Kosina <hidden>
Date
2010-02-16 12:55:23
Also in
linux-bluetooth, lkml
Reply to
Ed Tomlinson, 2010-02-16
On Tue, 16 Feb 2010, Ed Tomlinson wrote:
quoted
Almost... you need to do hid_hw_stop() first and only then unregister
input device, Otherwise if you unload the module while moving the mouse
it is likely to still oops.
The exit routing for the module also has a hid_hw_stop.  Is it going to cause
problems when it gets called twice?
The routine wasn't probably meant/designed with re-entrancy in mind, but 
looking quickly at all the subsequent callpaths, I don't see why it should 
cause any problem, as skb_queue_purge(), usb_kill_urb() and usb_free_urb() 
should be safe.

Maybe we should even add test_bit() for HID_STARTED and HID_DISCONNECTED 
at the beginning of the low-level drivers' ->stop callbacks, so that we 
don't do all the magic when all the work has been already done.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
Thread (13 messages) 13 messages, 5 authors, last reply 2010-02-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help