linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: Fix UUID string comparison in current_uuid_store()
@ 2025-10-17  7:27 Kaushlendra Kumar
  2025-10-29 16:40 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Kaushlendra Kumar @ 2025-10-17  7:27 UTC (permalink / raw)
  To: rafael, daniel.lezcano, rui.zhang, srinivas.pandruvada
  Cc: linux-pm, Kaushlendra Kumar

Use strlen() for UUID matching instead of sizeof() to ensure
correct comparison of supported UUIDs. sizeof() returns pointer
size instead of actual string length, causing incomplete UUID
matching.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
---
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 908cc1bf57f1..236003d12dc7 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -199,7 +199,7 @@ static ssize_t current_uuid_store(struct device *dev,
 
 	for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; ++i) {
 		if (!strncmp(buf, int3400_thermal_uuids[i],
-			     sizeof(int3400_thermal_uuids[i]) - 1)) {
+			     strlen(int3400_thermal_uuids[i]))) {
 			/*
 			 * If we have a list of supported UUIDs, make sure
 			 * this one is supported.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-30  4:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17  7:27 [PATCH] thermal: Fix UUID string comparison in current_uuid_store() Kaushlendra Kumar
2025-10-29 16:40 ` Rafael J. Wysocki
2025-10-29 18:40   ` Rafael J. Wysocki
2025-10-30  4:04     ` Kumar, Kaushlendra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).