Xiaolei Wang 78e1e867f4
regulator: pfuze100: Fix the global-out-of-bounds access in pfuze100_regulator_probe()
The pfuze_chip::regulator_descs is an array of size
PFUZE100_MAX_REGULATOR, the pfuze_chip::pfuze_regulators
is the pointer to the real regulators of a specific device.
The number of real regulator is supposed to be less than
the PFUZE100_MAX_REGULATOR, so we should use the size of
'regulator_num * sizeof(struct pfuze_regulator)' in memcpy().
This fixes the out of bounds access bug reported by KASAN.

Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Link: https://lore.kernel.org/r/20220825111922.1368055-1-xiaolei.wang@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-25 12:29:26 +01:00
..
2021-06-04 15:27:10 +01:00
2022-07-07 12:23:44 +01:00
2019-06-18 19:12:47 +01:00
2020-05-08 18:18:13 +01:00
2019-12-17 13:08:41 -08:00
2022-03-07 13:15:01 +00:00
2022-08-04 12:12:54 -07:00
2022-03-07 13:15:01 +00:00