diff options
author | Andi Kleen <andi@firstfloor.org> | 2008-10-13 06:03:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-29 18:03:49 -0400 |
commit | 4e318d7c6c9dd5cdae48bcf61558bbc0c09b12ac (patch) | |
tree | 07d2c2b0e559cb121292eea21f1e63245deaa8c5 /drivers | |
parent | 65151365ad59af00e229d0fe33b4f1f9350c685f (diff) |
sysfs: Fix return values for sysdev_store_{ulong,int}
SYSFS: Fix return values for sysdev_store_{ulong,int}
Always return the full size instead of the consumed
length of the string in sysdev_store_{ulong,int}
This avoids EINVAL errors in some echo versions.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/sys.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 3ca9c5e8d765..c98c31ec2f75 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
@@ -488,7 +488,8 @@ ssize_t sysdev_store_ulong(struct sys_device *sysdev, | |||
488 | if (end == buf) | 488 | if (end == buf) |
489 | return -EINVAL; | 489 | return -EINVAL; |
490 | *(unsigned long *)(ea->var) = new; | 490 | *(unsigned long *)(ea->var) = new; |
491 | return end - buf; | 491 | /* Always return full write size even if we didn't consume all */ |
492 | return size; | ||
492 | } | 493 | } |
493 | EXPORT_SYMBOL_GPL(sysdev_store_ulong); | 494 | EXPORT_SYMBOL_GPL(sysdev_store_ulong); |
494 | 495 | ||
@@ -511,7 +512,8 @@ ssize_t sysdev_store_int(struct sys_device *sysdev, | |||
511 | if (end == buf || new > INT_MAX || new < INT_MIN) | 512 | if (end == buf || new > INT_MAX || new < INT_MIN) |
512 | return -EINVAL; | 513 | return -EINVAL; |
513 | *(int *)(ea->var) = new; | 514 | *(int *)(ea->var) = new; |
514 | return end - buf; | 515 | /* Always return full write size even if we didn't consume all */ |
516 | return size; | ||
515 | } | 517 | } |
516 | EXPORT_SYMBOL_GPL(sysdev_store_int); | 518 | EXPORT_SYMBOL_GPL(sysdev_store_int); |
517 | 519 | ||