提交 765cd29d 编写于 作者: Z ZhaoLong Wang 提交者: openeuler-sync-bot

hikey9xx: Fixed incorrect use of kfree to free sreg

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6GS86
CVE: NA

--------------------------------

When memory allocated by using the devm_kmalloc(). the matching
release function should use the devm_kfree() function instead of
the kfree() function.

@sreg allocated:
hi6421_spmi_regulator_probe
  hi6421_spmi_regulator_probe_ldo

@sreg freed:
hi6421_spmi_regulator_remove
Signed-off-by: NZhaoLong Wang <wangzhaolong1@huawei.com>
(cherry picked from commit 8a31aa41)
上级 6be888e9
...@@ -452,7 +452,7 @@ static int hi6421_spmi_regulator_remove(struct platform_device *pdev) ...@@ -452,7 +452,7 @@ static int hi6421_spmi_regulator_remove(struct platform_device *pdev)
if (rdev->desc->volt_table) if (rdev->desc->volt_table)
devm_kfree(&pdev->dev, (unsigned int *)rdev->desc->volt_table); devm_kfree(&pdev->dev, (unsigned int *)rdev->desc->volt_table);
kfree(sreg); devm_kfree(&pdev->dev, sreg);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册