Explorar o código

Pretend there are no virtio devices when memory allocation failed for
the control structures.

Signed-off-by: golubovsky <golubovsky@gmail.com>

golubovsky %!s(int64=8) %!d(string=hai) anos
pai
achega
e700975e7a
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      sys/src/9/port/virtio_lib.c

+ 1 - 0
sys/src/9/port/virtio_lib.c

@@ -408,6 +408,7 @@ virtiosetup()
 	cvq = mallocz(nvq * sizeof(Vqctl *), 1);
 	if(cvq == nil) {
 		print("virtiosetup: failed to allocate control structures\n");
+		nvq = 0;
 		return;
 	}
 	initvdevs(cvq);