mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
ASoC: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp()
[ Upstream commit4d06f92f38
] The function devm_kzalloc() in rt5663_parse_dp() can fail, so its return value should be checked. Fixes:457c25efc5
("ASoC: rt5663: Add the function of impedance sensing") Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Link: https://lore.kernel.org/r/20220225131030.27248-1-baijiaju1990@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b7dd177225
commit
750eb7d6d9
@ -3463,6 +3463,8 @@ static int rt5663_parse_dp(struct rt5663_priv *rt5663, struct device *dev)
|
|||||||
table_size = sizeof(struct impedance_mapping_table) *
|
table_size = sizeof(struct impedance_mapping_table) *
|
||||||
rt5663->pdata.impedance_sensing_num;
|
rt5663->pdata.impedance_sensing_num;
|
||||||
rt5663->imp_table = devm_kzalloc(dev, table_size, GFP_KERNEL);
|
rt5663->imp_table = devm_kzalloc(dev, table_size, GFP_KERNEL);
|
||||||
|
if (!rt5663->imp_table)
|
||||||
|
return -ENOMEM;
|
||||||
ret = device_property_read_u32_array(dev,
|
ret = device_property_read_u32_array(dev,
|
||||||
"realtek,impedance_sensing_table",
|
"realtek,impedance_sensing_table",
|
||||||
(u32 *)rt5663->imp_table, table_size);
|
(u32 *)rt5663->imp_table, table_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user