aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-07-06 23:54:48 -0400
committerDmitry Torokhov <dtor@insightbb.com>2006-07-06 23:54:48 -0400
commit95349fe8144b7d18f04bdca1c2d3fb85789de4fb (patch)
tree90c603c34b9ae521342467b29ba0cdeba60cef5f /drivers
parent699756199d65700e8deed59ae250439ca8684686 (diff)
Input: libps2 - warn instead of oopsing when passed bad arguments
This is more user-friendly and also fixes Coverity #id 249 Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/serio/libps2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index 61a6f977846f..ed202f2f251a 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -177,6 +177,11 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
177 return -1; 177 return -1;
178 } 178 }
179 179
180 if (send && !param) {
181 WARN_ON(1);
182 return -1;
183 }
184
180 mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING); 185 mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING);
181 186
182 serio_pause_rx(ps2dev->serio); 187 serio_pause_rx(ps2dev->serio);