Showing error 1131

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: drivers/thermal/thermal_sys.c
Line in file: 68
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-29 14:49:11 UTC


Source:

 38#define PREFIX "Thermal: "
 39
 40struct thermal_cooling_device_instance {
 41        int id;
 42        char name[THERMAL_NAME_LENGTH];
 43        struct thermal_zone_device *tz;
 44        struct thermal_cooling_device *cdev;
 45        int trip;
 46        char attr_name[THERMAL_NAME_LENGTH];
 47        struct device_attribute attr;
 48        struct list_head node;
 49};
 50
 51static DEFINE_IDR(thermal_tz_idr);
 52static DEFINE_IDR(thermal_cdev_idr);
 53static DEFINE_MUTEX(thermal_idr_lock);
 54
 55static LIST_HEAD(thermal_tz_list);
 56static LIST_HEAD(thermal_cdev_list);
 57static DEFINE_MUTEX(thermal_list_lock);
 58
 59static int get_idr(struct idr *idr, struct mutex *lock, int *id)
 60{
 61        int err;
 62
 63      again:
 64        if (unlikely(idr_pre_get(idr, GFP_KERNEL) == 0))
 65                return -ENOMEM;
 66
 67        if (lock)
 68                mutex_lock(lock);
 69        err = idr_get_new(idr, NULL, id);
 70        if (lock)
 71                mutex_unlock(lock);
 72        if (unlikely(err == -EAGAIN))
 73                goto again;
 74        else if (unlikely(err))
 75                return err;
 76
 77        *id = *id & MAX_ID_MASK;
 78        return 0;
Show full sources