Skip to content

Commit

Permalink
HID: pidff: effect can't be NULL
Browse files Browse the repository at this point in the history
Force-beedback core guarantees that the 'effect' pointer that's being passed
to ->upload() callback is non-NULL.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Kosina committed Mar 27, 2015
1 parent f1088b3 commit b9e9cd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/usbhid/hid-pidff.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect,
int error;

pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0] = 0;
if (old && effect) {
if (old) {
pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0] =
pidff->pid_id[effect->id];
}
Expand Down

0 comments on commit b9e9cd3

Please sign in to comment.