aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <[email protected]>2023-04-03 21:02:39 +0100
committerMark Brown <[email protected]>2023-04-04 12:46:46 +0100
commit451941ac1ee2be125ac5029593a64b04badaa314 (patch)
tree5224e09c5b29423a67e642bacbf8059dae55c5a6
parentf033c26de5a5734625d2dd1dc196745fae186f1b (diff)
regmap: Fix double unlock in the maple cache
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/base/regmap/regcache-maple.c5
1 files 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);