summaryrefslogtreecommitdiffstats
path: root/kernel/time/clocksource.c
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2013-10-11 19:11:55 +0200
committerJohn Stultz <john.stultz@linaro.org>2013-10-19 01:45:58 +0200
commit891292a767c2453af0e5be9465e95b06b4b29ebe (patch)
tree86f9d3856dd7cb253f2b635274b78e81da7e8fe5 /kernel/time/clocksource.c
parenttimekeeping: Fix some trivial typos in comments (diff)
downloadlinux-891292a767c2453af0e5be9465e95b06b4b29ebe.tar.xz
linux-891292a767c2453af0e5be9465e95b06b4b29ebe.zip
time: Fix signedness bug in sysfs_get_uname() and its callers
sysfs_get_uname() is erroneously declared as returning size_t even though it may return a negative value, specifically -EINVAL. Its callers then check whether its return value is less than zero and indeed that is never the case for size_t. This patch changes sysfs_get_uname() to return ssize_t and makes sure its callers use ssize_t accordingly. Signed-off-by: Patrick Palka <patrick@parcs.ath.cx> [jstultz: Didn't apply cleanly, as a similar partial fix was also applied so had to resolve the collisions] Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time/clocksource.c')
-rw-r--r--kernel/time/clocksource.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index c9317e14aae6..ba3e502c955a 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -909,7 +909,7 @@ sysfs_show_current_clocksources(struct device *dev,
return count;
}
-size_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)
+ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)
{
size_t ret = cnt;