Skip to content

Commit afb923b

Browse files
committed
Merge tag 'regmap-fix-v6.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fixes from Mark Brown: "A couple of small fixes, one error handling one and another for misuse of the hwspinlock API" * tag 'regmap-fix-v6.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Fix race condition in hwspinlock irqsave routine regmap: maple: free entry on mas_store_gfp() failure
2 parents 1f664bb + 4b58aac commit afb923b

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

drivers/base/regmap/regcache-maple.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ static int regcache_maple_write(struct regmap *map, unsigned int reg,
9595

9696
mas_unlock(&mas);
9797

98-
if (ret == 0) {
99-
kfree(lower);
100-
kfree(upper);
98+
if (ret) {
99+
kfree(entry);
100+
return ret;
101101
}
102-
103-
return ret;
102+
kfree(lower);
103+
kfree(upper);
104+
return 0;
104105
}
105106

106107
static int regcache_maple_drop(struct regmap *map, unsigned int min,

drivers/base/regmap/regmap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,11 @@ static void regmap_lock_hwlock_irq(void *__map)
408408
static void regmap_lock_hwlock_irqsave(void *__map)
409409
{
410410
struct regmap *map = __map;
411+
unsigned long flags = 0;
411412

412413
hwspin_lock_timeout_irqsave(map->hwlock, UINT_MAX,
413-
&map->spinlock_flags);
414+
&flags);
415+
map->spinlock_flags = flags;
414416
}
415417

416418
static void regmap_unlock_hwlock(void *__map)

0 commit comments

Comments
 (0)