Browse Source

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 <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Jiri Kosina 10 years ago
parent
commit
b9e9cd32ba
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/hid/usbhid/hid-pidff.c

+ 1 - 1
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];
 	}