Showing error 1552

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: 134
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

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);
124        if (!dev)
125                goto out;
126        if (dev->ieee80211_ptr) {
127                drv = wiphy_to_dev(dev->ieee80211_ptr->wiphy);
128                mutex_lock(&drv->mtx);
129        } else
130                drv = ERR_PTR(-ENODEV);
131        dev_put(dev);
132 out:
133        mutex_unlock(&cfg80211_drv_mutex);
134        return drv;
135}
136
137void cfg80211_put_dev(struct cfg80211_registered_device *drv)
138{
139        BUG_ON(IS_ERR(drv));
140        mutex_unlock(&drv->mtx);
141}
142
143int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
144                        char *newname)
Show full sources