Input: mousedev - fix race when creating mixed device
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 6 Mar 2014 20:57:24 +0000 (12:57 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Apr 2014 08:32:23 +0000 (10:32 +0200)
commit3e477ed8dc6eb0415e9118d691688664080029ed
tree6dccfb9e51ac5e0c29934cfca01099ad27afe131
parent710e5cbeeb6869bb0f1227ce3cba7374449fdeb4
Input: mousedev - fix race when creating mixed device

commit e4dbedc7eac7da9db363a36f2bd4366962eeefcc upstream.

We should not be using static variable mousedev_mix in methods that can be
called before that singleton gets assigned. While at it let's add open and
close methods to mousedev structure so that we do not need to test if we
are dealing with multiplexor or normal device and simply call appropriate
method directly.

This fixes: https://bugzilla.kernel.org/show_bug.cgi?id=71551

Reported-by: GiulioDP <depasquale.giulio@gmail.com>
Tested-by: GiulioDP <depasquale.giulio@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/input/mousedev.c