Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: force feedback - make sure effect is present before playing

Make sure that requested effect id is not out of range for the
device and that effect is present before requesting device to
play it.

Reported-by: Jan Kratochvil <honza@jikos.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

+2 -1
+2 -1
drivers/input/ff-core.c
··· 281 281 break; 282 282 283 283 default: 284 - ff->playback(dev, code, value); 284 + if (check_effect_access(ff, code, NULL) == 0) 285 + ff->playback(dev, code, value); 285 286 break; 286 287 } 287 288