Explorar o código

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>
Dmitry Torokhov %!s(int64=18) %!d(string=hai) anos
pai
achega
dec3eb01c2
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      drivers/input/ff-core.c

+ 2 - 1
drivers/input/ff-core.c

@@ -281,7 +281,8 @@ int input_ff_event(struct input_dev *dev, unsigned int type,
 		break;
 
 	default:
-		ff->playback(dev, code, value);
+		if (check_effect_access(ff, code, NULL) == 0)
+			ff->playback(dev, code, value);
 		break;
 	}