Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c don't prop_object_retain(NULL)



details:   https://anonhg.NetBSD.org/src/rev/a7c645f6dddf
branches:  trunk
changeset: 1021263:a7c645f6dddf
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri May 21 20:42:05 2021 +0000

description:
don't prop_object_retain(NULL)

diffstat:

 sys/dev/i2c/lm75.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 22c5db8826b5 -r a7c645f6dddf sys/dev/i2c/lm75.c
--- a/sys/dev/i2c/lm75.c        Fri May 21 20:23:35 2021 +0000
+++ b/sys/dev/i2c/lm75.c        Fri May 21 20:42:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lm75.c,v 1.42 2021/03/01 04:40:39 rin Exp $    */
+/*     $NetBSD: lm75.c,v 1.43 2021/05/21 20:42:05 macallan Exp $       */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.42 2021/03/01 04:40:39 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.43 2021/05/21 20:42:05 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -215,7 +215,8 @@
        sc->sc_tag = ia->ia_tag;
        sc->sc_address = ia->ia_addr;
        sc->sc_prop = ia->ia_prop;
-       prop_object_retain(sc->sc_prop);
+       
+       if (ia->ia_prop != NULL) prop_object_retain(sc->sc_prop);
 
        aprint_naive(": Temperature Sensor\n");
        if (ia->ia_name) {



Home | Main Index | Thread Index | Old Index