summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormacallan <macallan@NetBSD.org>2021-05-21 20:42:05 +0000
committermacallan <macallan@NetBSD.org>2021-05-21 20:42:05 +0000
commit6cc7646e04e7f0076bf3ab6659abe51df3db656f (patch)
tree1134b4ef4078549deeb0a3ea7dd79d27aca8c5ac
parenta975af2e7e06dda7cd4a5d71e8d677dd33787420 (diff)
don't prop_object_retain(NULL)
-rw-r--r--sys/dev/i2c/lm75.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/i2c/lm75.c b/sys/dev/i2c/lm75.c
index 345cf4fab68..d74a85d7175 100644
--- a/sys/dev/i2c/lm75.c
+++ b/sys/dev/i2c/lm75.c
@@ -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 @@ lmtemp_attach(device_t parent, device_t self, void *aux)
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) {