Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Prevent a panic during system shutdown when vioi...
details: https://anonhg.NetBSD.org/src/rev/87dd0d918f7d
branches: trunk
changeset: 347099:87dd0d918f7d
user: tron <tron%NetBSD.org@localhost>
date: Sun Aug 14 07:47:15 2016 +0000
description:
Prevent a panic during system shutdown when vioif(4) is used
diffstat:
sys/dev/pci/virtio.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 8c641b1fef46 -r 87dd0d918f7d sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c Sun Aug 14 03:43:03 2016 +0000
+++ b/sys/dev/pci/virtio.c Sun Aug 14 07:47:15 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio.c,v 1.16 2016/07/11 06:14:51 knakahara Exp $ */
+/* $NetBSD: virtio.c,v 1.17 2016/08/14 07:47:15 tron Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.16 2016/07/11 06:14:51 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.17 2016/08/14 07:47:15 tron Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -418,7 +418,8 @@
pci_intr_disestablish(sc->sc_pc, sc->sc_ihs[i]);
}
pci_intr_release(sc->sc_pc, sc->sc_ihp, sc->sc_ihs_num);
- kmem_free(sc->sc_ihs, sizeof(*sc->sc_ihs) * sc->sc_ihs_num);
+ if (sc->sc_ihs != NULL)
+ kmem_free(sc->sc_ihs, sizeof(*sc->sc_ihs) * sc->sc_ihs_num);
sc->sc_ihs_num = 0;
if (sc->sc_iosize)
bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
Home |
Main Index |
Thread Index |
Old Index