drivers/input/joystick/iforce/iforce-main.c: fix check after use
PATCH 1/1 drivers/input/joystick/iforce/iforce-main.c: fix check after use
This patch fixes an obvious check after use found by the Coverity checker.
Signed-off-by Adrian Bunk <[email protected]>
drivers/input/joystick/iforce/iforce-main.c renamed from drivers/input/joystick/iforce/iforce-main.c.old +3 -3
@@ -221,15 +221,15 @@ static int iforce_erase_effect(struct inint err =0 ;struct iforce_core_effect * core_effect; +if (effect_id <0 || effect_id >=FF_EFFECTS_MAX ) +return -EINVAL ; +/* Check who is trying to erase this effect */ if (iforce->core_effects[effect_id].owner != current->pid) {printk (KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n" , current->pid, iforce->core_effects[effect_id].owner);return -EACCES ; } -if (effect_id <0 || effect_id >=FF_EFFECTS_MAX ) -return -EINVAL ; - core_effect = iforce->core_effects + effect_id;if (test_bit (FF_MOD1_IS_USED , core_effect->flags))