diff options
-rw-r--r-- | drivers/input/joystick/iforce/iforce-main.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index 6d99e3c37884..dc6cfea23866 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c | |||
@@ -222,22 +222,22 @@ static int iforce_erase_effect(struct input_dev *dev, int effect_id) | |||
222 | int err = 0; | 222 | int err = 0; |
223 | struct iforce_core_effect* core_effect; | 223 | struct iforce_core_effect* core_effect; |
224 | 224 | ||
225 | /* Check who is trying to erase this effect */ | ||
226 | if (iforce->core_effects[effect_id].owner != current->pid) { | ||
227 | printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, iforce->core_effects[effect_id].owner); | ||
228 | return -EACCES; | ||
229 | } | ||
230 | |||
231 | if (effect_id < 0 || effect_id >= FF_EFFECTS_MAX) | 225 | if (effect_id < 0 || effect_id >= FF_EFFECTS_MAX) |
232 | return -EINVAL; | 226 | return -EINVAL; |
233 | 227 | ||
234 | core_effect = iforce->core_effects + effect_id; | 228 | core_effect = &iforce->core_effects[effect_id]; |
229 | |||
230 | /* Check who is trying to erase this effect */ | ||
231 | if (core_effect->owner != current->pid) { | ||
232 | printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, core_effect->owner); | ||
233 | return -EACCES; | ||
234 | } | ||
235 | 235 | ||
236 | if (test_bit(FF_MOD1_IS_USED, core_effect->flags)) | 236 | if (test_bit(FF_MOD1_IS_USED, core_effect->flags)) |
237 | err = release_resource(&(iforce->core_effects[effect_id].mod1_chunk)); | 237 | err = release_resource(&core_effect->mod1_chunk); |
238 | 238 | ||
239 | if (!err && test_bit(FF_MOD2_IS_USED, core_effect->flags)) | 239 | if (!err && test_bit(FF_MOD2_IS_USED, core_effect->flags)) |
240 | err = release_resource(&(iforce->core_effects[effect_id].mod2_chunk)); | 240 | err = release_resource(&core_effect->mod2_chunk); |
241 | 241 | ||
242 | /*TODO: remember to change that if more FF_MOD* bits are added */ | 242 | /*TODO: remember to change that if more FF_MOD* bits are added */ |
243 | core_effect->flags[0] = 0; | 243 | core_effect->flags[0] = 0; |