If {c,m}alloc fail, info could be NULL and result in NULL deref.
Reported by Ilja van Sprundel.
ok mlarkin@
-/* $OpenBSD: virtio.c,v 1.94 2021/08/29 11:14:27 dv Exp $ */
+/* $OpenBSD: virtio.c,v 1.95 2021/08/29 11:41:27 dv Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
info = vioblk_start_read(dev,
cmd.sector + secbias, secdata_desc->len);
+ if (info == NULL) {
+ log_warnx("vioblk: can't start read");
+ goto out;
+ }
+
/* read the data, use current data descriptor */
secdata = vioblk_finish_read(info);
if (secdata == NULL) {