Commit f74d63b8 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Mark Brown

regmap: destroy mutex (if used) in regmap_exit()

While not destroying mutexes doesn't lead to memory leaks, it's still
the correct thing to do for mutex debugging accounting.
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20200928120614.23172-1-brgl@bgdev.plSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1d512ee8
...@@ -1370,6 +1370,8 @@ void regmap_exit(struct regmap *map) ...@@ -1370,6 +1370,8 @@ void regmap_exit(struct regmap *map)
} }
if (map->hwlock) if (map->hwlock)
hwspin_lock_free(map->hwlock); hwspin_lock_free(map->hwlock);
if (map->lock == regmap_lock_mutex)
mutex_destroy(&map->mutex);
kfree_const(map->name); kfree_const(map->name);
kfree(map->patch); kfree(map->patch);
kfree(map); kfree(map);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment