aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi/scsi-disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/scsi/scsi-disk.c')
-rw-r--r--hw/scsi/scsi-disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 300ba01..010eefd 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2310,7 +2310,7 @@ static void scsi_disk_realize(SCSIDevice *dev, Error **errp)
}
dinfo = blk_legacy_dinfo(dev->conf.blk);
- if (dinfo->media_cd) {
+ if (dinfo && dinfo->media_cd) {
scsi_cd_realize(dev, errp);
} else {
scsi_hd_realize(dev, errp);