mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
net: dsa: realtek: use devm_mutex_init for l2_lock
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.
Fixes: 336e3e4a1a ("net: dsa: realtek: rtl8365mb: add FDB support")
Reviewed-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
Link: https://patch.msgid.link/20260726-realtek_mutext-v2-4-5d62ba998791@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a95f3e9b89
commit
442ecdc83d
|
|
@ -164,7 +164,9 @@ rtl83xx_probe(struct device *dev,
|
|||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
mutex_init(&priv->l2_lock);
|
||||
ret = devm_mutex_init(dev, &priv->l2_lock);
|
||||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
rc.lock_arg = priv;
|
||||
priv->map = devm_regmap_init(dev, NULL, priv, &rc);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user