Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 09f8f2c

Browse files
committed
Merge tag 'regmap-fix-v6.10-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fix from Mark Brown: "Guenter ran with memory sanitisers and found an issue in the new KUnit tests that Richard added where an assumption in older test code was exposed, this was fixed quickly by Richard" * tag 'regmap-fix-v6.10-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: kunit: Fix array overflow in stride() test
2 parents 66ad482 + 7ba8221 commit 09f8f2c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/base/regmap/regmap-kunit.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,12 +609,19 @@ static void stride(struct kunit *test)
609609
config.reg_stride = 2;
610610
config.num_reg_defaults = BLOCK_TEST_SIZE / 2;
611611

612+
/*
613+
* Allow one extra register so that the read/written arrays
614+
* are sized big enough to include an entry for the odd
615+
* address past the final reg_default register.
616+
*/
617+
config.max_register = BLOCK_TEST_SIZE;
618+
612619
map = gen_regmap(test, &config, &data);
613620
KUNIT_ASSERT_FALSE(test, IS_ERR(map));
614621
if (IS_ERR(map))
615622
return;
616623

617-
/* Only even registers can be accessed, try both read and write */
624+
/* Only even addresses can be accessed, try both read and write */
618625
for (i = 0; i < BLOCK_TEST_SIZE; i++) {
619626
data->read[i] = false;
620627
data->written[i] = false;

0 commit comments

Comments
 (0)