mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
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>
This commit is contained in:
parent
699756199d
commit
95349fe814
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue