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 | if (!priv) | 156 | if (!priv) |
| 157 | return ERR_PTR(-ENOMEM); | 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 | mutex_init(&priv->vlan_lock); | 163 | mutex_init(&priv->vlan_lock); |
| 161 | mutex_init(&priv->l2_lock); | 164 | mutex_init(&priv->l2_lock); |
| 162 | 165 | ||