From a1cf27e23275569e4e0024fe32ca393e0174aca1 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Mon, 28 Nov 2016 05:50:01 +0900 Subject: [PATCH] sched_getaffinity(): fix error code for special invalid input --- kernel/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index 2a16dbb4..cfa76a88 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -5856,7 +5856,7 @@ SYSCALL_DECLARE(sched_getaffinity) int ret; dkprintf("%s() len: %d, mask: %p\n", __FUNCTION__, len, u_cpu_set); - if (!len) + if (!len || u_cpu_set == (cpu_set_t *)-1) return -EINVAL; if ((len * BITS_PER_BYTE) < __CPU_SETSIZE)