With CONFIG_DEBUG_MUTEXES enabled, mutex_destroy() needs to be called before the lock is discarded. Use devm_mutex_init() instead so the cleanup is handled automatically.
Unified · Split
| @@ -156,7 +156,10 @@ rtl83xx_probe(struct device *dev, · 155 unmodified lines | ||
| 156 | 156 | if (!priv) |
| 157 | 157 | return ERR_PTR(-ENOMEM); |
| 158 | 158 | |
| 159 | − mutex_init(&priv->map_lock); | |
| 159 | + ret = devm_mutex_init(dev, &priv->map_lock); | |
| 160 | + if (ret) | |
| 161 | + return ERR_PTR(ret); | |
| 162 | + | |
| 160 | 163 | mutex_init(&priv->vlan_lock); |
| 161 | 164 | mutex_init(&priv->l2_lock); |
| 162 | 165 | |