drivers/tty/vt/keyboard.c: In function 'vt_do_kdgkb_ioctl': drivers/tty/vt/keyboard.c: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] return ret; ^~~ drivers/tty/vt/keyboard.c: warning: 'kbs' may be used uninitialized in this function [-Wmaybe-uninitialized] kfree(kbs); ^~~~~~~~~~
Signed-off-by: Li Wang <li.w...@windriver.com> --- drivers/tty/vt/keyboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index 7763862..62f1ecb 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -2090,6 +2090,8 @@ int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm) ret = 0; break; + default: + return -EINVAL; } kfree(kbs); -- 2.7.4