Skip to contentSkip to conversation

PATCH: fix bogus ioctl return in mtrr

PATCH Alan Cox 1 participant 1 message Jul 27, 2004

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

This is fairly self explanatory - ENOIOCTLCMD is an internal code outside of the -1 to -511 range. The correct return for an unknown ioctl is -ENOTTY although some Linux devices return the incorrect -EINVAL result.

OSDL Developer Certificate of Origin 1.0 included herein by reference

arch/i386/kernel/cpu/mtrr/if.c +1 -1
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.7/arch/i386/kernel/cpu/mtrr/if.c 2.6.7-ac/arch/i386/kernel/cpu/mtrr/if.c
@@ -160,7 +160,7 @@
 
 	switch (cmd) {
 	default:
-		return -ENOIOCTLCMD;
+		return -ENOTTY;
 	case MTRRIOC_ADD_ENTRY:
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;