From: aravindanilraj0702@gmail.com
To: rafael@kernel.org, linux-pm@vger.kernel.org
Cc: daniel.lezcano@kernel.org, rui.zhang@intel.com,
lukasz.luba@arm.com, srinivas.pandruvada@linux.intel.com,
linux-kernel@vger.kernel.org,
Aravind Anilraj <aravindanilraj0702@gmail.com>
Subject: [PATCH 2/2] thermal: intel: int340x: Check return value of ptc_create_groups()
Date: Sat, 28 Mar 2026 15:18:06 -0400 [thread overview]
Message-ID: <20260328191806.8675-3-aravindanilraj0702@gmail.com> (raw)
In-Reply-To: <20260328191806.8675-1-aravindanilraj0702@gmail.com>
From: Aravind Anilraj <aravindanilraj0702@gmail.com>
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>
---
.../intel/int340x_thermal/platform_temperature_control.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/platform_temperature_control.c b/drivers/thermal/intel/int340x_thermal/platform_temperature_control.c
index 18ac5014d8dc..caed572c6061 100644
--- a/drivers/thermal/intel/int340x_thermal/platform_temperature_control.c
+++ b/drivers/thermal/intel/int340x_thermal/platform_temperature_control.c
@@ -278,12 +278,14 @@ 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)
+ return ret;
}
ptc_create_debugfs();
--
2.47.3
prev parent reply other threads:[~2026-03-28 19:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-28 19:18 [PATCH 0/2] thermal: intel: int340x: Fix bugs in aravindanilraj0702
2026-03-28 19:18 ` [PATCH 1/2] thermal: intel: int340x: Fix potential shift overflow in ptc_mmio_write aravindanilraj0702
2026-03-28 19:18 ` aravindanilraj0702 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260328191806.8675-3-aravindanilraj0702@gmail.com \
--to=aravindanilraj0702@gmail.com \
--cc=daniel.lezcano@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox