linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regmap: destroy mutex (if used) in regmap_exit()
@ 2020-09-28 12:06 Bartosz Golaszewski
  2020-09-28 19:35 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2020-09-28 12:06 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

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>
---
 drivers/base/regmap/regmap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index b71f9ecddff5..5ecd7a57700d 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1365,6 +1365,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);
-- 
2.26.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regmap: destroy mutex (if used) in regmap_exit()
  2020-09-28 12:06 [PATCH] regmap: destroy mutex (if used) in regmap_exit() Bartosz Golaszewski
@ 2020-09-28 19:35 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-09-28 19:35 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Bartosz Golaszewski, linux-kernel

On Mon, 28 Sep 2020 14:06:14 +0200, Bartosz Golaszewski wrote:
> While not destroying mutexes doesn't lead to memory leaks, it's still
> the correct thing to do for mutex debugging accounting.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap: destroy mutex (if used) in regmap_exit()
      commit: f74d63b8c24ad90ee56b5723b72feb0d1f894177

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-28 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 12:06 [PATCH] regmap: destroy mutex (if used) in regmap_exit() Bartosz Golaszewski
2020-09-28 19:35 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).