Patchwork [3/8] qdev: Fix crash on -device '?=x'

login
register
mail settings
Submitter Stefan Hajnoczi
Date Nov. 10, 2011, 12:36 p.m.
Message ID <1320928604-6642-4-git-send-email-stefanha@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/124873/
State New
Headers show

Comments

Stefan Hajnoczi - Nov. 10, 2011, 12:36 p.m.
From: Markus Armbruster <armbru@redhat.com>

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 hw/qdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index 50976dd..106407f 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -186,7 +186,7 @@  int qdev_device_help(QemuOpts *opts)
         return 1;
     }
 
-    if (!qemu_opt_get(opts, "?")) {
+    if (!driver || !qemu_opt_get(opts, "?")) {
         return 0;
     }