Skip to content

Commit a6bec44

Browse files
committed
Merge tag 'regmap-fix-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fixes from Mark Brown: "Richard found a nasty corner case in the maple tree code which he fixed, and also fixed a compiler warning which was showing up with the toolchain he uses and helpfully identified a possible incorrect error code which could have runtime impacts" * tag 'regmap-fix-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: maple: Fix uninitialized symbol 'ret' warnings regmap: maple: Fix cache corruption in regcache_maple_drop()
2 parents 8a05ef7 + eaa0348 commit a6bec44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/base/regmap/regcache-maple.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
112112
unsigned long *entry, *lower, *upper;
113113
unsigned long lower_index, lower_last;
114114
unsigned long upper_index, upper_last;
115-
int ret;
115+
int ret = 0;
116116

117117
lower = NULL;
118118
upper = NULL;
@@ -145,7 +145,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
145145
upper_index = max + 1;
146146
upper_last = mas.last;
147147

148-
upper = kmemdup(&entry[max + 1],
148+
upper = kmemdup(&entry[max - mas.index + 1],
149149
((mas.last - max) *
150150
sizeof(unsigned long)),
151151
map->alloc_flags);
@@ -244,7 +244,7 @@ static int regcache_maple_sync(struct regmap *map, unsigned int min,
244244
unsigned long lmin = min;
245245
unsigned long lmax = max;
246246
unsigned int r, v, sync_start;
247-
int ret;
247+
int ret = 0;
248248
bool sync_needed = false;
249249

250250
map->cache_bypass = true;

0 commit comments

Comments
 (0)