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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Apr 2014 19:02:34 +0000 (12:02 -0700)
commite9148d1137b5b950d8d2b5ea87bcd21c2726017d
tree4124055dc6ec2ed907c155b5d44b3f542efe28dc
parent7ce510b1e42d51dfbf2e184778039a34dbba6131
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/mousedev.c