linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regmap: Fix double unlock in the maple cache
@ 2023-04-03 20:02 Mark Brown
  2023-04-04 14:43 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2023-04-03 20:02 UTC (permalink / raw)
  To: Liam.Howlett; +Cc: linux-mm, linux-kernel, Mark Brown

Doing the dance to drop the maple tree's internal spinlock means we need
multiple exit paths in our error handling.

Reported-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/base/regmap/regcache-maple.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c
index 497cc708d277..20fb7228fc6b 100644
--- a/drivers/base/regmap/regcache-maple.c
+++ b/drivers/base/regmap/regcache-maple.c
@@ -137,7 +137,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
 					GFP_KERNEL);
 			if (!lower) {
 				ret = -ENOMEM;
-				goto out;
+				goto out_unlocked;
 			}
 		}
 
@@ -151,7 +151,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
 					GFP_KERNEL);
 			if (!upper) {
 				ret = -ENOMEM;
-				goto out;
+				goto out_unlocked;
 			}
 		}
 
@@ -179,6 +179,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
 
 out:
 	mas_unlock(&mas);
+out_unlocked:
 	kfree(lower);
 	kfree(upper);
 

---
base-commit: f033c26de5a5734625d2dd1dc196745fae186f1b
change-id: 20230403-regmap-maple-unlock-98aa84cc47f5

Best regards,
-- 
Mark Brown <broonie@kernel.org>



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

* Re: [PATCH] regmap: Fix double unlock in the maple cache
  2023-04-03 20:02 [PATCH] regmap: Fix double unlock in the maple cache Mark Brown
@ 2023-04-04 14:43 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-04-04 14:43 UTC (permalink / raw)
  To: Liam.Howlett, Mark Brown; +Cc: linux-mm, linux-kernel

On Mon, 03 Apr 2023 21:02:39 +0100, Mark Brown wrote:
> Doing the dance to drop the maple tree's internal spinlock means we need
> multiple exit paths in our error handling.
> 
> 

Applied to

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

Thanks!

[1/1] regmap: Fix double unlock in the maple cache
      commit: 451941ac1ee2be125ac5029593a64b04badaa314

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:[~2023-04-04 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 20:02 [PATCH] regmap: Fix double unlock in the maple cache Mark Brown
2023-04-04 14:43 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox