Skip to content

Commit

Permalink
Input: force feedback - make sure effect is present before playing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov committed May 3, 2007
1 parent 84767d0 commit dec3eb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/input/ff-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit dec3eb0

Please sign in to comment.