Showing error 1703

User: Jiri Slaby
Error type: Double Unlock
Error type description: Some lock is unlocked twice unintentionally in a sequence
File location: drivers/input/joystick/analog.c
Line in file: 257
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 15:16:58 UTC


Source:

227 * analog_cooked_read() reads analog joystick data.
228 */
229
230static int analog_cooked_read(struct analog_port *port)
231{
232        struct gameport *gameport = port->gameport;
233        unsigned int time[4], start, loop, now, loopout, timeout;
234        unsigned char data[4], this, last;
235        unsigned long flags;
236        int i, j;
237
238        loopout = (ANALOG_LOOP_TIME * port->loop) / 1000;
239        timeout = ANALOG_MAX_TIME * port->speed;
240
241        local_irq_save(flags);
242        gameport_trigger(gameport);
243        GET_TIME(now);
244        local_irq_restore(flags);
245
246        start = now;
247        this = port->mask;
248        i = 0;
249
250        do {
251                loop = now;
252                last = this;
253
254                local_irq_disable();
255                this = gameport_read(gameport) & port->mask;
256                GET_TIME(now);
257                local_irq_restore(flags);
258
259                if ((last ^ this) && (DELTA(loop, now) < loopout)) {
260                        data[i] = last ^ this;
261                        time[i] = now;
262                        i++;
263                }
264
265        } while (this && (i < 4) && (DELTA(start, now) < timeout));
266
267        this <<= 4;
Show full sources