diff options
Diffstat (limited to 'drivers/input/joystick/iforce/iforce-main.c')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-main.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index 6d99e3c37884..b4914e7231f8 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c | |||
@@ -79,6 +79,7 @@ static struct iforce_device iforce_device[] = { | |||
79 | { 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //? | 79 | { 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //? |
80 | { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //? | 80 | { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //? |
81 | { 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //? | 81 | { 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //? |
82 | { 0x06d6, 0x29bc, "Trust Force Feedback Race Master", btn_wheel, abs_wheel, ff_iforce }, | ||
82 | { 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]", btn_joystick, abs_joystick, ff_iforce } | 83 | { 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]", btn_joystick, abs_joystick, ff_iforce } |
83 | }; | 84 | }; |
84 | 85 | ||
@@ -222,22 +223,22 @@ static int iforce_erase_effect(struct input_dev *dev, int effect_id) | |||
222 | int err = 0; | 223 | int err = 0; |
223 | struct iforce_core_effect* core_effect; | 224 | struct iforce_core_effect* core_effect; |
224 | 225 | ||
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) | 226 | if (effect_id < 0 || effect_id >= FF_EFFECTS_MAX) |
232 | return -EINVAL; | 227 | return -EINVAL; |
233 | 228 | ||
234 | core_effect = iforce->core_effects + effect_id; | 229 | core_effect = &iforce->core_effects[effect_id]; |
230 | |||
231 | /* Check who is trying to erase this effect */ | ||
232 | if (core_effect->owner != current->pid) { | ||
233 | printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, core_effect->owner); | ||
234 | return -EACCES; | ||
235 | } | ||
235 | 236 | ||
236 | if (test_bit(FF_MOD1_IS_USED, core_effect->flags)) | 237 | if (test_bit(FF_MOD1_IS_USED, core_effect->flags)) |
237 | err = release_resource(&(iforce->core_effects[effect_id].mod1_chunk)); | 238 | err = release_resource(&core_effect->mod1_chunk); |
238 | 239 | ||
239 | if (!err && test_bit(FF_MOD2_IS_USED, core_effect->flags)) | 240 | if (!err && test_bit(FF_MOD2_IS_USED, core_effect->flags)) |
240 | err = release_resource(&(iforce->core_effects[effect_id].mod2_chunk)); | 241 | err = release_resource(&core_effect->mod2_chunk); |
241 | 242 | ||
242 | /*TODO: remember to change that if more FF_MOD* bits are added */ | 243 | /*TODO: remember to change that if more FF_MOD* bits are added */ |
243 | core_effect->flags[0] = 0; | 244 | core_effect->flags[0] = 0; |