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 <Liam.Howlett@Oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230403-regmap-maple-unlock-v1-1-89998991b16c@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f033c26de5
commit
451941ac1e
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user