Skip to contentSkip to conversation

hwmon: (asus-ec-sensors) add missed handle for ENOMEM

PATCH Applied Eugene Shalygin 3 participants 4 messages Jul 12 – Jul 19

Subsystems (2)
lore
Share & tools
lore

Eugene Shalygin

author maintainer
#0 lore raw

v3 cover hwmon: (asus-ec-sensors) add missed handle for ENOMEM

v3: fix formatting

v2: fix silly mistake when 0 would be returned from the setup function in case of error in asus_ec_hwmon_add_chan_info(), making the module load in partially initialized state.

Eugene Shalygin (1):
hwmon: (asus-ec-sensors) add missed handle for ENOMEM

 drivers/hwmon/asus-ec-sensors.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.55.0
author maintainer
#1 lore raw

PATCH v3 1/1 hwmon: (asus-ec-sensors) add missed handle for ENOMEM

Add missing return value check in the setup function.

Fixes d0ddfd241e57 ("hwmon: (asus-ec-sensors) add driver for ASUS EC")
---
 drivers/hwmon/asus-ec-sensors.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/hwmon/asus-ec-sensors.c +5 -3
index eb71e41fd4f4..65d2bb1aa8ff 100644
@@ -1495,9 +1495,11 @@ static int asus_ec_probe(struct platform_device *pdev)
 		if (!nr_count[type])
 			continue;
 
-		asus_ec_hwmon_add_chan_info(asus_ec_hwmon_chan, dev,
-					     nr_count[type], type,
-					     hwmon_attributes[type]);
+		status = asus_ec_hwmon_add_chan_info(asus_ec_hwmon_chan, dev,
+						     nr_count[type], type,
+						     hwmon_attributes[type]);
+		if (status)
+			return status;
 		*ptr_asus_ec_ci++ = asus_ec_hwmon_chan++;
 	}
 
Signature · 1 line
2.55.0
#2 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 3 lines

Add missing return value check in the setup function.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1