Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Add NULL check for TAILQ_FIRST
details: https://anonhg.NetBSD.org/src/rev/cdec7b60fe55
branches: trunk
changeset: 337957:cdec7b60fe55
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Mon May 04 14:02:13 2015 +0000
description:
Add NULL check for TAILQ_FIRST
diffstat:
sys/dev/pci/viomb.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r c8251925069f -r cdec7b60fe55 sys/dev/pci/viomb.c
--- a/sys/dev/pci/viomb.c Mon May 04 12:23:15 2015 +0000
+++ b/sys/dev/pci/viomb.c Mon May 04 14:02:13 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: viomb.c,v 1.3 2014/07/22 01:55:54 ozaki-r Exp $ */
+/* $NetBSD: viomb.c,v 1.4 2015/05/04 14:02:13 ozaki-r Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viomb.c,v 1.3 2014/07/22 01:55:54 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viomb.c,v 1.4 2015/05/04 14:02:13 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -383,6 +383,8 @@
TAILQ_INIT(&b->bl_pglist);
for (i = 0; i < nhpages; i++) {
p = TAILQ_FIRST(&sc->sc_balloon_pages);
+ if (p == NULL)
+ break;
TAILQ_REMOVE(&sc->sc_balloon_pages, p, pageq.queue);
TAILQ_INSERT_TAIL(&b->bl_pglist, p, pageq.queue);
b->bl_pages[i] = p->phys_addr / VIRTIO_PAGE_SIZE;
Home |
Main Index |
Thread Index |
Old Index