From: Gerd Hoffmann Date: Mon, 31 Aug 2009 12:23:57 +0000 (+0200) Subject: allow passing null machine pointer to drive_init(). X-Git-Tag: v0.12.0-rc0~1259 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d00781419371beea3704229f8ce1ca772d41ec8;p=thirdparty%2Fqemu.git allow passing null machine pointer to drive_init(). Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- diff --git a/vl.c b/vl.c index 098daaad0f8..ff0e5432a50 100644 --- a/vl.c +++ b/vl.c @@ -1928,7 +1928,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");