Showing error 1553

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


Source:

 83                if (bywiphy != byifidx)
 84                        return ERR_PTR(-EINVAL);
 85                else
 86                        return bywiphy; /* == byifidx */
 87        }
 88        if (bywiphy)
 89                return bywiphy;
 90
 91        if (byifidx)
 92                return byifidx;
 93
 94        return ERR_PTR(err);
 95}
 96
 97struct cfg80211_registered_device *
 98cfg80211_get_dev_from_info(struct genl_info *info)
 99{
100        struct cfg80211_registered_device *drv;
101
102        mutex_lock(&cfg80211_drv_mutex);
103        drv = __cfg80211_drv_from_info(info);
104
105        /* if it is not an error we grab the lock on
106         * it to assure it won't be going away while
107         * we operate on it */
108        if (!IS_ERR(drv))
109                mutex_lock(&drv->mtx);
110
111        mutex_unlock(&cfg80211_drv_mutex);
112
113        return drv;
114}
115
116struct cfg80211_registered_device *
117cfg80211_get_dev_from_ifindex(int ifindex)
118{
119        struct cfg80211_registered_device *drv = ERR_PTR(-ENODEV);
120        struct net_device *dev;
121
122        mutex_lock(&cfg80211_drv_mutex);
123        dev = dev_get_by_index(&init_net, ifindex);
Show full sources