regmap: Fixes for v6.9

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.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmYQeR4ACgkQJNaLcl1U
 h9BT/Af/VYd0T8y0gpEV6DRcEca9MWucll2K/9yUBMwMae2N56RWIYPFj+K3mwQO
 /KjbEWK9EUzagLZNUMC2gUjY1MEmrq4eKHf/XzjO5Ija8hhYkun51sFZ7jj2Axua
 4qaYfRcpfMaFW37Dq7wCRG8Lc62XlbGFXejjknoE/dvsiwVZUzAL/CNgWebeg8pZ
 68Ffu5560HBpqGO2PSkKfJwvwWsjhWaFiLSdmsCU54pWCWEAFFVJI9jj3f9ZCK26
 P8d7MhlVud5wBJ1nnFqjc4qdLj+91ulVCAfmXG2j+nbBSq1C8IcHuw8QjAtYRXDy
 hFxE/VVLnFVeIOjYgK3yw55WjdmAgA==
 =H/t6
 -----END PGP SIGNATURE-----

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()
This commit is contained in:
Linus Torvalds 2024-04-05 17:21:16 -07:00
commit a6bec447a8
1 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
unsigned long *entry, *lower, *upper;
unsigned long lower_index, lower_last;
unsigned long upper_index, upper_last;
int ret;
int ret = 0;
lower = NULL;
upper = NULL;
@ -145,7 +145,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
upper_index = max + 1;
upper_last = mas.last;
upper = kmemdup(&entry[max + 1],
upper = kmemdup(&entry[max - mas.index + 1],
((mas.last - max) *
sizeof(unsigned long)),
map->alloc_flags);
@ -244,7 +244,7 @@ static int regcache_maple_sync(struct regmap *map, unsigned int min,
unsigned long lmin = min;
unsigned long lmax = max;
unsigned int r, v, sync_start;
int ret;
int ret = 0;
bool sync_needed = false;
map->cache_bypass = true;