Messages in this thread | | | From | Adam Ward <> | Subject | RE: [PATCH] regulator: da9121: Fix uninit-value in da9121_assign_chip_model() | Date | Thu, 21 Apr 2022 09:24:50 +0000 |
| |
On 21 April 2022 10:04, Wei Yongjun wrote:
> This happend when da9121 device is probe by da9121_i2c_id, but with > invalid dts. Thus, chip->subvariant_id is set to -EINVAL, and later > da9121_assign_chip_model() will access 'regmap' without init it. > > Fix it by return -EINVAL from da9121_assign_chip_model() if > 'chip->subvariant_id' is invalid. > > Fixes: f3fbd5566f6a ("regulator: da9121: Add device variants") > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Adam Ward <Adam.Ward.Opensource@diasemi.com>
| |