Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

thermal: int340x: Fix sysfs group leak on DLVR registration failure

When DLVR sysfs group creation fails in proc_thermal_rfim_add(),
the function returns immediately without cleaning up the FIVR group
that may have been created earlier.

Add proper error unwinding to remove the FIVR group before returning
failure.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/LV3PR11MB876881B77D32A2854AD2908EF563A@LV3PR11MB8768.namprd11.prod.outlook.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Kaushlendra Kumar and committed by
Rafael J. Wysocki
15176b81 0506158a

+4 -1
+4 -1
drivers/thermal/intel/int340x_thermal/processor_thermal_rfim.c
··· 467 467 break; 468 468 } 469 469 ret = sysfs_create_group(&pdev->dev.kobj, &dlvr_attribute_group); 470 - if (ret) 470 + if (ret) { 471 + if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_FIVR) 472 + sysfs_remove_group(&pdev->dev.kobj, &fivr_attribute_group); 471 473 return ret; 474 + } 472 475 } 473 476 474 477 if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_DVFS) {