Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic don't try to handle sensors if there aren't any.



details:   https://anonhg.NetBSD.org/src/rev/7955792b4159
branches:  trunk
changeset: 781699:7955792b4159
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Sep 23 01:13:52 2012 +0000

description:
don't try to handle sensors if there aren't any.

diffstat:

 sys/dev/ic/ciss.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r e7527972892c -r 7955792b4159 sys/dev/ic/ciss.c
--- a/sys/dev/ic/ciss.c Sun Sep 23 01:13:21 2012 +0000
+++ b/sys/dev/ic/ciss.c Sun Sep 23 01:13:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ciss.c,v 1.27 2011/06/20 22:02:55 pgoyette Exp $       */
+/*     $NetBSD: ciss.c,v 1.28 2012/09/23 01:13:52 chs Exp $    */
 /*     $OpenBSD: ciss.c,v 1.14 2006/03/13 16:02:23 mickey Exp $        */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.27 2011/06/20 22:02:55 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.28 2012/09/23 01:13:52 chs Exp $");
 
 #include "bio.h"
 
@@ -1411,6 +1411,10 @@
        int                     i;
        int nsensors = sc->maxunits;
 
+       if (nsensors == 0) {
+               return 0;
+       }
+
        sc->sc_sme = sysmon_envsys_create();
        sc->sc_sensor = malloc(sizeof(envsys_data_t) * nsensors,
                M_DEVBUF, M_NOWAIT | M_ZERO);



Home | Main Index | Thread Index | Old Index