ChiYuan Huang e9d055b8df mfd: mt6360: Add bounds checking in Regmap read/write call-backs
commit 5f4f94e9f26cca6514474b307b59348b8485e711 upstream.

Fix the potential risk of OOB read if bank index is over the maximum.

Refer to the discussion list for the experiment result on mt6370.
https://lore.kernel.org/all/20220914013345.GA5802@cyhuang-hp-elitebook-840-g3.rt/
If not to check the bound, there is the same issue on mt6360.

Cc: stable@vger.kernel.org
Fixes: 3b0850440a06c (mfd: mt6360: Merge different sub-devices I2C read/write)
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/1664416817-31590-1-git-send-email-u0084500@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-04 11:29:01 +01:00
..
2022-03-25 13:56:18 -07:00
2022-08-06 10:25:16 -07:00
2022-08-16 12:46:26 +02:00
2022-10-07 11:24:20 -07:00
2022-03-21 18:33:57 -07:00
2022-10-07 11:24:20 -07:00
2022-08-16 12:46:26 +02:00
2022-10-07 11:24:20 -07:00
2019-07-15 20:18:40 -07:00
2022-09-28 16:09:50 +01:00
2022-08-16 12:46:26 +02:00
2022-08-16 12:46:26 +02:00
2022-10-07 11:24:20 -07:00
2022-08-16 12:46:26 +02:00
2022-09-28 16:09:50 +01:00
2022-08-16 12:46:26 +02:00
2022-09-28 16:17:40 +01:00
2019-07-09 08:59:39 -07:00
2022-10-07 11:24:20 -07:00