]> git.baikalelectronics.ru Git - kernel.git/commit
regmap-irq: Fix offset/index mismatch in read_sub_irq_data()
authorAidan MacDonald <aidanmacdonald.0x0@gmail.com>
Mon, 20 Jun 2022 20:05:57 +0000 (21:05 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 22 Jun 2022 10:59:52 +0000 (11:59 +0100)
commitf3d78846eea1d723e6d3e210d44c8ff6b96bc5c2
tree191e259686b9b625eb7775b1a56dd803fa07f7bf
parent52af6908b287a8937106d078559cea685b3d8daf
regmap-irq: Fix offset/index mismatch in read_sub_irq_data()

We need to divide the sub-irq status register offset by register
stride to get an index for the status buffer to avoid an out of
bounds write when the register stride is greater than 1.

Fixes: af6ac8fe5ba8 ("regmap: regmap-irq: Add main status register support")
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20220620200644.1961936-3-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-irq.c