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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jun 2022 07:03:25 +0000 (09:03 +0200)
commit60fd29f1ff46370c9c0a72aeedf4f40f2dea9f93
tree8efcdfcf69a206d721779e3934bd0b4811664430
parentb0581f93cf05010549c2abe1c04dc6d6f5cafdf9
regmap-irq: Fix offset/index mismatch in read_sub_irq_data()

[ Upstream commit 3f05010f243be06478a9b11cfce0ce994f5a0890 ]

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: a2d21848d921 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/base/regmap/regmap-irq.c