From: Graham Gower <graham.gower@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/char/vt_ioctl.c: Fix VT_OPENQRY error value
Date: Fri, 03 Sep 2010 16:01:14 +0930 [thread overview]
Message-ID: <4C809632.6090706@gmail.com> (raw)
When all VT's are in use, VT_OPENQRY casts -1 to unsigned char
before returning it to userspace as an int. VT255 is not the next
available console.
Signed-off-by: Graham Gower <graham.gower@gmail.com>
--- drivers/char/vt_ioctl.c~ 2010-08-11 04:07:31.000000000 +0930
+++ drivers/char/vt_ioctl.c 2010-09-03 15:12:30.000000000 +0930
@@ -503,6 +503,7 @@
struct kbd_struct * kbd;
unsigned int console;
unsigned char ucval;
+ unsigned int uival;
void __user *up = (void __user *)arg;
int i, perm;
int ret = 0;
@@ -657,7 +658,7 @@
break;
case KDGETMODE:
- ucval = vc->vc_mode;
+ uival = vc->vc_mode;
goto setint;
case KDMAPDISP:
@@ -695,7 +696,7 @@
break;
case KDGKBMODE:
- ucval = ((kbd->kbdmode == VC_RAW) ? K_RAW :
+ uival = ((kbd->kbdmode == VC_RAW) ? K_RAW :
(kbd->kbdmode == VC_MEDIUMRAW) ? K_MEDIUMRAW :
(kbd->kbdmode == VC_UNICODE) ? K_UNICODE :
K_XLATE);
@@ -949,7 +950,7 @@
for (i = 0; i < MAX_NR_CONSOLES; ++i)
if (! VT_IS_IN_USE(i))
break;
- ucval = i < MAX_NR_CONSOLES ? (i+1) : -1;
+ uival = i < MAX_NR_CONSOLES ? (i+1) : -1;
goto setint;
/*
next reply other threads:[~2010-09-03 6:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-03 6:31 Graham Gower [this message]
2010-09-03 6:48 ` [PATCH] drivers/char/vt_ioctl.c: Fix VT_OPENQRY error value Graham Gower
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C809632.6090706@gmail.com \
--to=graham.gower@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.