The patch titled acpi_power_meter: don't leak ACPI error codes to userspace has been added to the -mm tree. Its filename is acpi_power_meter-dont-leak-acpi-error-codes-to-userspace.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: acpi_power_meter: don't leak ACPI error codes to userspace From: "Darrick J. Wong" <djwong@xxxxxxxxxx> If the ACPI methods return an error code, we must return -EINVAL to userspace to flag the error. Right now we pass the (positive) number right through, which causes echo to keep writing bogus values. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> Acked-by: Jean Delvare <khali@xxxxxxxxxxxx> Cc: Len Brown <lenb@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN drivers/acpi/power_meter.c~acpi_power_meter-dont-leak-acpi-error-codes-to-userspace drivers/acpi/power_meter.c --- a/drivers/acpi/power_meter.c~acpi_power_meter-dont-leak-acpi-error-codes-to-userspace +++ a/drivers/acpi/power_meter.c @@ -294,7 +294,11 @@ static int set_acpi_trip(struct acpi_pow 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, _ Patches currently in -mm which might be from djwong@xxxxxxxxxx are origin.patch linux-next.patch acpi_power_meter-dont-leak-acpi-error-codes-to-userspace.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html