Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/fifofs Access fifoinfo only when it's non-NULL.



details:   https://anonhg.NetBSD.org/src/rev/8ac8a580512a
branches:  trunk
changeset: 753411:8ac8a580512a
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sat Mar 27 02:33:11 2010 +0000

description:
Access fifoinfo only when it's non-NULL.

diffstat:

 sys/miscfs/fifofs/fifo_vnops.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r 99c021970a87 -r 8ac8a580512a sys/miscfs/fifofs/fifo_vnops.c
--- a/sys/miscfs/fifofs/fifo_vnops.c    Fri Mar 26 21:33:28 2010 +0000
+++ b/sys/miscfs/fifofs/fifo_vnops.c    Sat Mar 27 02:33:11 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fifo_vnops.c,v 1.66 2008/04/28 20:24:08 martin Exp $   */
+/*     $NetBSD: fifo_vnops.c,v 1.67 2010/03/27 02:33:11 pooka Exp $    */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.66 2008/04/28 20:24:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.67 2010/03/27 02:33:11 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -528,9 +528,10 @@
 {
        struct fifoinfo *fip;
 
-       fip = vp->v_fifoinfo;
-       printf(", fifo with %d readers and %d writers",
-           fip->fi_readers, fip->fi_writers);
+       if ((fip = vp->v_fifoinfo) != NULL) {
+               printf(", fifo with %d readers and %d writers",
+                   fip->fi_readers, fip->fi_writers);
+       }
 }
 
 /*



Home | Main Index | Thread Index | Old Index