summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd/vioraw.c
diff options
context:
space:
mode:
authorccardenas <ccardenas@cvs.openbsd.org>2018-09-19 04:29:22 +0000
committerccardenas <ccardenas@cvs.openbsd.org>2018-09-19 04:29:22 +0000
commit6f514c141b51fd641a140b0e9b1b0b4c992fa0c1 (patch)
tree2ae2f71bab5d0982a38501c4d638afb4fbbf4c85 /usr.sbin/vmd/vioraw.c
parent8082160e4b9dc503ffdfafdcc1d122091acd4cfc (diff)
Various clean up items for disks.
- qcow2: general cleanup - vioraw: check malloc - virtio: add function to sync disks - vm: call virtio_shutdown to sync disks when vm is finished executing Thanks to Ori Bernstein. Ok miko@
Diffstat (limited to 'usr.sbin/vmd/vioraw.c')
-rw-r--r--usr.sbin/vmd/vioraw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/vmd/vioraw.c b/usr.sbin/vmd/vioraw.c
index 4b87c649407..621d7a6854d 100644
--- a/usr.sbin/vmd/vioraw.c
+++ b/usr.sbin/vmd/vioraw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vioraw.c,v 1.1 2018/08/25 04:16:09 ccardenas Exp $ */
+/* $OpenBSD: vioraw.c,v 1.2 2018/09/19 04:29:21 ccardenas Exp $ */
/*
* Copyright (c) 2018 Ori Bernstein <ori@eigenstate.org>
*
@@ -62,6 +62,8 @@ virtio_init_raw(struct virtio_backing *file, off_t *szp, int fd)
return -1;
fdp = malloc(sizeof(int));
+ if (!fdp)
+ return -1;
*fdp = fd;
file->p = fdp;
file->pread = raw_pread;