[PATCH] kernel/itimer.c: for return value, using -EINVAL insteadof -EFAULT

From: Chen Gang
Date: Thu Jun 20 2013 - 02:23:47 EST



For the system call getitimer(), if the parameter 'value' is NULL, need
return -EINVAL, not -EFAULT.

Signed-off-by: Chen Gang <gang.chen@xxxxxxxxxxx>
---
kernel/itimer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/itimer.c b/kernel/itimer.c
index 8d262b4..6f9d757 100644
--- a/kernel/itimer.c
+++ b/kernel/itimer.c
@@ -102,7 +102,7 @@ int do_getitimer(int which, struct itimerval *value)

SYSCALL_DEFINE2(getitimer, int, which, struct itimerval __user *, value)
{
- int error = -EFAULT;
+ int error = -EINVAL;
struct itimerval get_buffer;

if (value) {
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/