From: Jiri Kosina Date: Fri, 27 Mar 2015 15:03:26 +0000 (+0100) Subject: HID: pidff: effect can't be NULL X-Git-Tag: v4.1-rc1~150^2~1^10~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9e9cd32ba33d13c7ecbc15b9f4418beded403d2;p=platform%2Fkernel%2Flinux-exynos.git HID: pidff: effect can't be NULL Force-beedback core guarantees that the 'effect' pointer that's being passed to ->upload() callback is non-NULL. Reported-by: Dan Carpenter Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index 1b3fa70..08174d3 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -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]; }