diff mbox

sparc: semtimedop() unreachable due to comparison error

Message ID 1425363415-4154-1-git-send-email-rob.gardner@oracle.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Rob Gardner March 3, 2015, 6:16 a.m. UTC
A bug was reported that the semtimedop() system call was always
failing eith ENOSYS.

Since SEMCTL is defined as 3, and SEMTIMEDOP is defined as 4,
the comparison "call <= SEMCTL" will always prevent SEMTIMEDOP
from getting through to the semaphore ops switch statement.

This is corrected by changing the comparison to "call <= SEMTIMEDOP".

Orabug: 20633375

Signed-off-by: Rob Gardner <rob.gardner@oracle.com>
---
 arch/sparc/kernel/sys_sparc_64.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 3, 2015, 10:06 p.m. UTC | #1
From: Rob Gardner <rob.gardner@oracle.com>
Date: Mon,  2 Mar 2015 23:16:55 -0700

> A bug was reported that the semtimedop() system call was always
> failing eith ENOSYS.
> 
> Since SEMCTL is defined as 3, and SEMTIMEDOP is defined as 4,
> the comparison "call <= SEMCTL" will always prevent SEMTIMEDOP
> from getting through to the semaphore ops switch statement.
> 
> This is corrected by changing the comparison to "call <= SEMTIMEDOP".
> 
> Orabug: 20633375
> 
> Signed-off-by: Rob Gardner <rob.gardner@oracle.com>

Amazing how something like this can be broken for so long.

Applied and queued up for -stable, thanks Rob.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index c85403d..30e7ddb 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -333,7 +333,7 @@  SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second
 	long err;
 
 	/* No need for backward compatibility. We can start fresh... */
-	if (call <= SEMCTL) {
+	if (call <= SEMTIMEDOP) {
 		switch (call) {
 		case SEMOP:
 			err = sys_semtimedop(first, ptr,