Showing error 1132

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: 84
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-29 14:49:11 UTC


Source:

 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;
 79}
 80
 81static void release_idr(struct idr *idr, struct mutex *lock, int id)
 82{
 83        if (lock)
 84                mutex_lock(lock);
 85        idr_remove(idr, id);
 86        if (lock)
 87                mutex_unlock(lock);
 88}
 89
 90/* sys I/F for thermal zone */
 91
 92#define to_thermal_zone(_dev) \
 93        container_of(_dev, struct thermal_zone_device, device)
 94
Show full sources