diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/virtio-blk.c | 1 | ||||
-rw-r--r-- | hw/sd/sd.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 49a23c33f7..13f6d8276e 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -703,7 +703,6 @@ static int virtio_blk_device_init(VirtIODevice *vdev) s->bs = blk->conf.bs; s->conf = &blk->conf; - memcpy(&(s->blk), blk, sizeof(struct VirtIOBlkConf)); s->rq = NULL; s->sector_mask = (s->conf->logical_block_size / BDRV_SECTOR_SIZE) - 1; diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 7380f063f7..4502ad143d 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -494,7 +494,7 @@ SDState *sd_init(BlockDriverState *bs, bool is_spi) { SDState *sd; - if (bdrv_is_read_only(bs)) { + if (bs && bdrv_is_read_only(bs)) { fprintf(stderr, "sd_init: Cannot use read-only drive\n"); return NULL; } |