Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Input: libps2 - warn instead of oopsing when passed bad arguments
Browse files Browse the repository at this point in the history
This is more user-friendly and also fixes Coverity #id 249

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dmitry Torokhov committed Jul 7, 2006
1 parent 6997561 commit 95349fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/input/serio/libps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 95349fe

Please sign in to comment.