Showing error 1251

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: drivers/char/misc.c
Line in file: 72
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

 42#include <linux/major.h>
 43#include <linux/slab.h>
 44#include <linux/mutex.h>
 45#include <linux/proc_fs.h>
 46#include <linux/seq_file.h>
 47#include <linux/stat.h>
 48#include <linux/init.h>
 49#include <linux/device.h>
 50#include <linux/tty.h>
 51#include <linux/kmod.h>
 52#include <linux/smp_lock.h>
 53
 54/*
 55 * Head entry for the doubly linked miscdevice list
 56 */
 57static LIST_HEAD(misc_list);
 58static DEFINE_MUTEX(misc_mtx);
 59
 60/*
 61 * Assigned numbers, used for dynamic minors
 62 */
 63#define DYNAMIC_MINORS 64 /* like dynamic majors */
 64static unsigned char misc_minors[DYNAMIC_MINORS / 8];
 65
 66extern int pmu_device_init(void);
 67
 68#ifdef CONFIG_PROC_FS
 69static void *misc_seq_start(struct seq_file *seq, loff_t *pos)
 70{
 71        mutex_lock(&misc_mtx);
 72        return seq_list_start(&misc_list, *pos);
 73}
 74
 75static void *misc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 76{
 77        return seq_list_next(v, &misc_list, pos);
 78}
 79
 80static void misc_seq_stop(struct seq_file *seq, void *v)
 81{
 82        mutex_unlock(&misc_mtx);
Show full sources