Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33184
b: refs/heads/master
c: 8d64d37
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Jul 7, 2006
1 parent 1796710 commit 0c0b5da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95349fe8144b7d18f04bdca1c2d3fb85789de4fb
refs/heads/master: 8d64d3722c6abbb43bccd518ececc5559e1962b4
18 changes: 9 additions & 9 deletions trunk/drivers/input/joystick/iforce/iforce-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,22 @@ static int iforce_erase_effect(struct input_dev *dev, int effect_id)
int err = 0;
struct iforce_core_effect* core_effect;

/* 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;
core_effect = &iforce->core_effects[effect_id];

/* Check who is trying to erase this effect */
if (core_effect->owner != current->pid) {
printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, core_effect->owner);
return -EACCES;
}

if (test_bit(FF_MOD1_IS_USED, core_effect->flags))
err = release_resource(&(iforce->core_effects[effect_id].mod1_chunk));
err = release_resource(&core_effect->mod1_chunk);

if (!err && test_bit(FF_MOD2_IS_USED, core_effect->flags))
err = release_resource(&(iforce->core_effects[effect_id].mod2_chunk));
err = release_resource(&core_effect->mod2_chunk);

/*TODO: remember to change that if more FF_MOD* bits are added */
core_effect->flags[0] = 0;
Expand Down

0 comments on commit 0c0b5da

Please sign in to comment.