Patchwork qdev: Fix crash on -device '?=x'

login
register
mail settings
Submitter Markus Armbruster
Date Nov. 8, 2011, 10 a.m.
Message ID <1320746438-31756-1-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/124312/
State New
Headers show

Comments

Markus Armbruster - Nov. 8, 2011, 10 a.m.
Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/qdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Stefan Hajnoczi - Nov. 8, 2011, 10:52 a.m.
On Tue, Nov 08, 2011 at 11:00:38AM +0100, Markus Armbruster wrote:
> Spotted by Coverity.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/qdev.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

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;
     }