diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-09-28 14:06:14 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-09-28 18:28:45 +0100 |
commit | f74d63b8c24ad90ee56b5723b72feb0d1f894177 (patch) | |
tree | 7e1d7e33c277f65b527069db72e44e92a5c1a8c9 /drivers/base/regmap | |
parent | 1d512ee861b80da63cbc501b973c53131aa22f29 (diff) |
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: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20200928120614.23172-1-brgl@bgdev.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r-- | drivers/base/regmap/regmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index a4d3d41f5221..5a121bee530c 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1370,6 +1370,8 @@ void regmap_exit(struct regmap *map) } if (map->hwlock) hwspin_lock_free(map->hwlock); + if (map->lock == regmap_lock_mutex) + mutex_destroy(&map->mutex); kfree_const(map->name); kfree(map->patch); kfree(map); |