summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorConstantine A. Murenin <cnst@cvs.openbsd.org>2008-11-10 05:19:49 +0000
committerConstantine A. Murenin <cnst@cvs.openbsd.org>2008-11-10 05:19:49 +0000
commit59817ba21264635cff793d717f65f2d8c36eb7bd (patch)
tree253a4f9faa1e172e2a36c56b38471eb86c33c15f /sys
parentce8919e4d085d3f90fc7037adb6f792b1a2b284c (diff)
uninitialised value caused some lmenv(4) fans to never appear sometimes;
the bug was reported long time ago by Simon Slaytor with adm9240; the eyes were cleared today by LLVM/Clang Static Analyser; ok deraadt
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/i2c/lm87.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/i2c/lm87.c b/sys/dev/i2c/lm87.c
index 1ecf04d2c7a..7a9389777cd 100644
--- a/sys/dev/i2c/lm87.c
+++ b/sys/dev/i2c/lm87.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm87.c,v 1.19 2007/06/24 05:34:35 dlg Exp $ */
+/* $OpenBSD: lm87.c,v 1.20 2008/11/10 05:19:48 cnst Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -141,7 +141,8 @@ lmenv_attach(struct device *parent, struct device *self, void *aux)
printf(", cannot read Channel register\n");
return;
}
- }
+ } else
+ channel = 0;
cmd = LM87_CONFIG1;
if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,