The patch titled LED: Fix sysfs store function error handling has been added to the -mm tree. Its filename is led-fix-sysfs-store-function-error-handling.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this From: Richard Purdie <rpurdie@xxxxxxxxx> Fix the error handling of some LED _store functions. This corrects them to return -EINVAL if the value is not numeric with an optional byte of trailing whitespace. Signed-off-by: Richard Purdie <rpurdie@xxxxxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/leds/led-class.c | 9 +++++++-- drivers/leds/ledtrig-timer.c | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff -puN drivers/leds/led-class.c~led-fix-sysfs-store-function-error-handling drivers/leds/led-class.c --- devel/drivers/leds/led-class.c~led-fix-sysfs-store-function-error-handling 2006-05-10 21:39:52.000000000 -0700 +++ devel-akpm/drivers/leds/led-class.c 2006-05-10 21:39:52.000000000 -0700 @@ -19,6 +19,7 @@ #include <linux/sysdev.h> #include <linux/timer.h> #include <linux/err.h> +#include <linux/ctype.h> #include <linux/leds.h> #include "leds.h" @@ -43,9 +44,13 @@ static ssize_t led_brightness_store(stru ssize_t ret = -EINVAL; char *after; unsigned long state = simple_strtoul(buf, &after, 10); + size_t count = after - buf; - if (after - buf > 0) { - ret = after - buf; + if (*after && isspace(*after)) + count++; + + if (count == size) { + ret = count; led_set_brightness(led_cdev, state); } diff -puN drivers/leds/ledtrig-timer.c~led-fix-sysfs-store-function-error-handling drivers/leds/ledtrig-timer.c --- devel/drivers/leds/ledtrig-timer.c~led-fix-sysfs-store-function-error-handling 2006-05-10 21:39:52.000000000 -0700 +++ devel-akpm/drivers/leds/ledtrig-timer.c 2006-05-10 21:39:52.000000000 -0700 @@ -20,6 +20,7 @@ #include <linux/device.h> #include <linux/sysdev.h> #include <linux/timer.h> +#include <linux/ctype.h> #include <linux/leds.h> #include "leds.h" @@ -69,11 +70,15 @@ static ssize_t led_delay_on_store(struct int ret = -EINVAL; char *after; unsigned long state = simple_strtoul(buf, &after, 10); + size_t count = after - buf; - if (after - buf > 0) { + if (*after && isspace(*after)) + count++; + + if (count == size) { timer_data->delay_on = state; mod_timer(&timer_data->timer, jiffies + 1); - ret = after - buf; + ret = count; } return ret; @@ -97,11 +102,15 @@ static ssize_t led_delay_off_store(struc int ret = -EINVAL; char *after; unsigned long state = simple_strtoul(buf, &after, 10); + size_t count = after - buf; + + if (*after && isspace(*after)) + count++; - if (after - buf > 0) { + if (count == size) { timer_data->delay_off = state; mod_timer(&timer_data->timer, jiffies + 1); - ret = after - buf; + ret = count; } return ret; _ Patches currently in -mm which might be from rpurdie@xxxxxxxxx are origin.patch led-improve-kconfig-information.patch backlight-lcd-class-fix-sysfs-_store-error-handling.patch led-add-maintainer-entry-for-the-led-subsystem.patch led-fix-sysfs-store-function-error-handling.patch via-pmu-add-input-device.patch via-pmu-add-input-device-tidy.patch git-mtd.patch zlib_inflate-upgrade-library-code-to-a-recent-version.patch zlib_inflate-upgrade-library-code-to-a-recent-version-fix.patch leds-amstrad-delta-led-support.patch leds-amstrad-delta-led-support-tidy.patch backlight-locomo-backlight-driver-updates.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