Showing error 1460

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: net/atm/resources.c
Line in file: 418
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

388                        if (size < 0) {
389                                error = (size == -ENOIOCTLCMD ? -EINVAL : size);
390                                goto done;
391                        }
392        }
393
394        if (size)
395                error = put_user(size, &sioc->length)
396                        ? -EFAULT : 0;
397        else
398                error = 0;
399done:
400        atm_dev_put(dev);
401        return error;
402}
403
404static __inline__ void *dev_get_idx(loff_t left)
405{
406        struct list_head *p;
407
408        list_for_each(p, &atm_devs) {
409                if (!--left)
410                        break;
411        }
412        return (p != &atm_devs) ? p : NULL;
413}
414
415void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos)
416{
417        mutex_lock(&atm_dev_mutex);
418        return *pos ? dev_get_idx(*pos) : SEQ_START_TOKEN;
419}
420
421void atm_dev_seq_stop(struct seq_file *seq, void *v)
422{
423        mutex_unlock(&atm_dev_mutex);
424}
425
426void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
427{
428        ++*pos;
Show full sources