qdev: Fix crash on -device '?=x'
authorMarkus Armbruster <armbru@redhat.com>
Tue, 8 Nov 2011 10:00:38 +0000 (11:00 +0100)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thu, 10 Nov 2011 12:29:50 +0000 (12:29 +0000)
Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/qdev.c

index 50976dd0c1c78ce50f0269f35f9ed5ba1df3b6ec..106407f226dee0cd5e0dc98dab3e8a00bd89a455 100644 (file)
--- 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;
     }