diff mbox

[1/9] allow passing null machine pointer to drive_init().

Message ID 1251721445-17824-2-git-send-email-kraxel@redhat.com
State Superseded
Headers show

Commit Message

Gerd Hoffmann Aug. 31, 2009, 12:23 p.m. UTC
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/vl.c b/vl.c
index a894285..6c6c4f8 100644
--- a/vl.c
+++ b/vl.c
@@ -1924,7 +1924,7 @@  DriveInfo *drive_init(QemuOpts *opts, void *opaque,
     translation = BIOS_ATA_TRANSLATION_AUTO;
     cache = 1;
 
-    if (machine->use_scsi) {
+    if (machine && machine->use_scsi) {
         type = IF_SCSI;
         max_devs = MAX_SCSI_DEVS;
         pstrcpy(devname, sizeof(devname), "scsi");