diff mbox

acpi_power_meter: Don't leak ACPI error codes to userspace

Message ID 20091022010137.GB21723@tux1.beaverton.ibm.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Darrick J. Wong Oct. 22, 2009, 1:01 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/acpi/power_meter.c b/drivers/acpi/power_meter.c
index e6bfd77..2ef7030 100644
--- a/drivers/acpi/power_meter.c
+++ b/drivers/acpi/power_meter.c
@@ -294,7 +294,11 @@  static int set_acpi_trip(struct acpi_power_meter_resource *resource)
 		return -EINVAL;
 	}
 
-	return data;
+	/* _PTP returns 0 on success, nonzero otherwise */
+	if (data)
+		return -EINVAL;
+
+	return 0;
 }
 
 static ssize_t set_trip(struct device *dev, struct device_attribute *devattr,