mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-23 03:57:32 -04:00
thermal: intel: int340x: Check return value of ptc_create_groups()
proc_thermal_ptc_add() ignores the return value of ptc_create_groups() causing the driver to silenty continue even if sysfs group creation fails. The thermal control interface would be unavailable with no indication of failure. Check the return value and on failure clean up any sysfs groups that were successfully created before the error, then propagate the error to the caller which already handles it correctly via goto err_rem_rapl. Signed-off-by: Aravind Anilraj <aravindanilraj0702@gmail.com> Link: https://patch.msgid.link/20260329070642.10721-3-aravindanilraj0702@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
1fac728735
commit
8aa807a89d
@@ -278,12 +278,18 @@ static void ptc_delete_debugfs(void)
|
||||
int proc_thermal_ptc_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv)
|
||||
{
|
||||
if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_PTC) {
|
||||
int i;
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; i < PTC_MAX_INSTANCES; i++) {
|
||||
ptc_instance[i].offset = ptc_offsets[i];
|
||||
ptc_instance[i].pdev = pdev;
|
||||
ptc_create_groups(pdev, i, &ptc_instance[i]);
|
||||
ret = ptc_create_groups(pdev, i, &ptc_instance[i]);
|
||||
if (ret) {
|
||||
while (i--)
|
||||
sysfs_remove_group(&pdev->dev.kobj,
|
||||
&ptc_instance[i].ptc_attr_group);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ptc_create_debugfs();
|
||||
|
||||
Reference in New Issue
Block a user