All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Koch <dkoch@verizon.com>
To: qemu-devel <qemu-devel@nongnu.org>,
	qemu-trivial <qemu-trivial@nongnu.org>,
	Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-trivial] [PATCH v2] Don't crash on keyboard input with no handler
Date: Tue, 19 Nov 2013 15:01:59 -0500	[thread overview]
Message-ID: <528BC3B7.2090205@terremark.com> (raw)

Prevent a call to put_kbd if null.

On shutdown of some OSes, the keyboard handler goes away before the
system is down. If a key is typed during this window, qemu crashes.

Signed-off-by: Don Koch <dkoch@verizon.com>
---
v2: punt printf()

 ui/input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/input.c b/ui/input.c
index 10d8c05..1c70f60 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -414,7 +414,7 @@ void kbd_put_keycode(int keycode)
     if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
         return;
     }
-    if (entry) {
+    if (entry && entry->put_kbd) {
         entry->put_kbd(entry->opaque, keycode);
     }
 }
-- 
1.8.1.4



WARNING: multiple messages have this Message-ID (diff)
From: Don Koch <dkoch@verizon.com>
To: qemu-devel <qemu-devel@nongnu.org>,
	qemu-trivial <qemu-trivial@nongnu.org>,
	Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PATCH v2] Don't crash on keyboard input with no handler
Date: Tue, 19 Nov 2013 15:01:59 -0500	[thread overview]
Message-ID: <528BC3B7.2090205@terremark.com> (raw)

Prevent a call to put_kbd if null.

On shutdown of some OSes, the keyboard handler goes away before the
system is down. If a key is typed during this window, qemu crashes.

Signed-off-by: Don Koch <dkoch@verizon.com>
---
v2: punt printf()

 ui/input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/input.c b/ui/input.c
index 10d8c05..1c70f60 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -414,7 +414,7 @@ void kbd_put_keycode(int keycode)
     if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
         return;
     }
-    if (entry) {
+    if (entry && entry->put_kbd) {
         entry->put_kbd(entry->opaque, keycode);
     }
 }
-- 
1.8.1.4

             reply	other threads:[~2013-11-19 20:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 20:01 Don Koch [this message]
2013-11-19 20:01 ` [Qemu-devel] [PATCH v2] Don't crash on keyboard input with no handler Don Koch
2013-12-02 17:18 ` [Qemu-trivial] " Michael Tokarev
2013-12-02 17:18   ` [Qemu-devel] " Michael Tokarev

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=528BC3B7.2090205@terremark.com \
    --to=dkoch@verizon.com \
    --cc=aliguori@amazon.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.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.