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

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
Markus Armbruster 2011-11-08 11:00:38 +01:00 committed by Stefan Hajnoczi
parent 235e510cfd
commit 542379f426

View File

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