[PATCH] xf86-input-joystick: Return proper default for unknown values in pInfo->device_control.

Terry Lambert tlambert at chromium.org
Fri Jul 15 17:23:22 PDT 2011


Signed-off-by: Terry Lambert <tlambert at chromium.org>
Reviewed-by: Stephane Marchesin <marcheu at chromium.org>
---
 src/jstk.c     |    3 +--
 src/jstk_key.c |    2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/jstk.c b/src/jstk.c
index ec6b79a..5fdbc1c 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -419,8 +419,7 @@ jstkDeviceControlProc(DeviceIntPtr       pJstk,
 
     default:
         ErrorF("unsupported mode=%d\n", what);
-        return !Success;
-        break;
+	return BadValue;
     } /* switch (what) */
     return Success;
 }
diff --git a/src/jstk_key.c b/src/jstk_key.c
index 3c471ce..bf41c39 100644
--- a/src/jstk_key.c
+++ b/src/jstk_key.c
@@ -169,6 +169,8 @@ jstkKeyboardDeviceControlProc(DeviceIntPtr       dev,
         DBG(2, ErrorF("jstkKeyboardDeviceControlProc what=DEVICE_CLOSE\n"));
         dev->public.on = FALSE;
         break;
+    default:
+	return BadValue;
     }
 
     return Success;
-- 
1.7.3.1



More information about the xorg-devel mailing list