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: ZhaoLong Wang wangzhaolong1@huawei.com --- drivers/staging/hikey9xx/hi6421v600-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c index 614b03c9ddfb..63204e460f53 100644 --- a/drivers/staging/hikey9xx/hi6421v600-regulator.c +++ b/drivers/staging/hikey9xx/hi6421v600-regulator.c @@ -452,7 +452,7 @@ static int hi6421_spmi_regulator_remove(struct platform_device *pdev) if (rdev->desc->volt_table) devm_kfree(&pdev->dev, (unsigned int *)rdev->desc->volt_table);
- kfree(sreg); + devm_kfree(&pdev->dev, sreg);
return 0; }
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/928 邮件列表地址: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/thread/TB...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/928 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/thread/TB...