From 891292a767c2453af0e5be9465e95b06b4b29ebe Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Fri, 11 Oct 2013 13:11:55 -0400 Subject: 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 [jstultz: Didn't apply cleanly, as a similar partial fix was also applied so had to resolve the collisions] Signed-off-by: John Stultz --- kernel/time/clockevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel/time/clockevents.c') diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 38959c866789..30554b9fb1f7 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -584,7 +584,7 @@ static ssize_t sysfs_unbind_tick_dev(struct device *dev, const char *buf, size_t count) { char name[CS_NAME_LEN]; - size_t ret = sysfs_get_uname(buf, name, count); + ssize_t ret = sysfs_get_uname(buf, name, count); struct clock_event_device *ce; if (ret < 0) -- cgit v1.2.3