From: Dmitry Torokhov Date: Fri, 7 Jul 2006 03:54:48 +0000 (-0400) Subject: Input: libps2 - warn instead of oopsing when passed bad arguments X-Git-Tag: v2.6.18-rc4~1^2~19 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95349fe8144b7d18f04bdca1c2d3fb85789de4fb;p=linux-2.6 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 --- diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c index 61a6f97784..ed202f2f25 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) return -1; } + if (send && !param) { + WARN_ON(1); + return -1; + } + mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING); serio_pause_rx(ps2dev->serio);