Module Name:    src
Committed By:   bouyer
Date:           Sat Sep  7 16:01:25 UTC 2013

Modified Files:
        src/sys/dev/pci [netbsd-6-0]: virtio.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #931):
        sys/dev/pci/virtio.c: revision 1.4
Make sure to check if the driver has a valid intr handler in virtio_detach().
Fixes a panic during shutdown on KVM under ubuntu 13.04 with virtio,
as reported in PR kern/48105 by Richard Hansen.
Should be pulled up to netbsd-6 branches.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.14.1 src/sys/dev/pci/virtio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.3 src/sys/dev/pci/virtio.c:1.3.14.1
--- src/sys/dev/pci/virtio.c:1.3	Wed Nov  2 23:05:52 2011
+++ src/sys/dev/pci/virtio.c	Sat Sep  7 16:01:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $	*/
+/*	$NetBSD: virtio.c,v 1.3.14.1 2013/09/07 16:01:25 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.3.14.1 2013/09/07 16:01:25 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -199,8 +199,10 @@ virtio_detach(device_t self, int flags)
 	}
 	KASSERT(sc->sc_child == 0 || sc->sc_child == (void*)1);
 	KASSERT(sc->sc_vqs == 0);
-	pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
-	sc->sc_ih = 0;
+	if (sc->sc_ih != NULL) {
+		pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
+		sc->sc_ih = NULL;
+	}
 	if (sc->sc_iosize)
 		bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
 	sc->sc_iosize = 0;

Reply via email to