Skip to content

Commit 99378fd

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: "A fix for a crash in uinput, and a fix for build errors when HID-RMI is built-in but SERIO is a module" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: synaptics-rmi4 - select 'SERIO' when needed Input: uinput - fix crash when mixing old and new init style
2 parents 189addc + 413d373 commit 99378fd

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

drivers/input/misc/uinput.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,21 @@ static int uinput_create_device(struct uinput_device *udev)
263263
return -EINVAL;
264264
}
265265

266-
if (test_bit(ABS_MT_SLOT, dev->absbit)) {
267-
nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1;
268-
error = input_mt_init_slots(dev, nslot, 0);
269-
if (error)
266+
if (test_bit(EV_ABS, dev->evbit)) {
267+
input_alloc_absinfo(dev);
268+
if (!dev->absinfo) {
269+
error = -EINVAL;
270270
goto fail1;
271-
} else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
272-
input_set_events_per_packet(dev, 60);
271+
}
272+
273+
if (test_bit(ABS_MT_SLOT, dev->absbit)) {
274+
nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1;
275+
error = input_mt_init_slots(dev, nslot, 0);
276+
if (error)
277+
goto fail1;
278+
} else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
279+
input_set_events_per_packet(dev, 60);
280+
}
273281
}
274282

275283
if (test_bit(EV_FF, dev->evbit) && !udev->ff_effects_max) {

drivers/input/rmi4/Kconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,19 @@ config RMI4_SMB
4242
config RMI4_F03
4343
bool "RMI4 Function 03 (PS2 Guest)"
4444
depends on RMI4_CORE
45-
depends on SERIO=y || RMI4_CORE=SERIO
4645
help
4746
Say Y here if you want to add support for RMI4 function 03.
4847

4948
Function 03 provides PS2 guest support for RMI4 devices. This
5049
includes support for TrackPoints on TouchPads.
5150

51+
config RMI4_F03_SERIO
52+
tristate
53+
depends on RMI4_CORE
54+
depends on RMI4_F03
55+
default RMI4_CORE
56+
select SERIO
57+
5258
config RMI4_2D_SENSOR
5359
bool
5460
depends on RMI4_CORE

0 commit comments

Comments
 (0)