Commit 6813a298 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Pu Lehui
Browse files

thermal: int340x_thermal: Consolidate priv->data_vault checks

mainline inclusion
from mainline-v6.1-rc1
commit e9a7c526
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9LKDZ
CVE: CVE-2022-48703

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e9a7c526c29b



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

It is sufficient to check priv->data_vault once in the error code path
of int3400_thermal_probe(), so do that.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarPu Lehui <pulehui@huawei.com>
parent 05a687d1
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -548,8 +548,7 @@ static int int3400_thermal_probe(struct platform_device *pdev)

free_sysfs:
	cleanup_odvp(priv);
	if (priv->data_vault) {
		if (!ZERO_OR_NULL_PTR(priv->data_vault))
	if (!ZERO_OR_NULL_PTR(priv->data_vault)) {
		sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
		kfree(priv->data_vault);
	}