diff options
author | 2008-02-27 17:25:00 +0000 | |
---|---|---|
committer | 2008-02-27 17:25:00 +0000 | |
commit | 19d2e64f9f4502323f5cb62dfc99b596a93a173a (patch) | |
tree | 82fc0617ce90f909f8a79f6f091dc54ddc929d44 | |
parent | fail nicely instead of crashing for format strings containing '*', (diff) | |
download | wireguard-openbsd-19d2e64f9f4502323f5cb62dfc99b596a93a173a.tar.xz wireguard-openbsd-19d2e64f9f4502323f5cb62dfc99b596a93a173a.zip |
return from tda_attach before registering the sensor task
if there are no temperature sensors
-rw-r--r-- | sys/arch/sparc64/dev/tda.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/sparc64/dev/tda.c b/sys/arch/sparc64/dev/tda.c index ca5cdfa8d98..6de04c4eae2 100644 --- a/sys/arch/sparc64/dev/tda.c +++ b/sys/arch/sparc64/dev/tda.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tda.c,v 1.3 2008/02/20 09:44:47 robert Exp $ */ +/* $OpenBSD: tda.c,v 1.4 2008/02/27 17:25:00 robert Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -120,6 +120,11 @@ tda_attach(struct device *parent, struct device *self, void *aux) } sc->sc_nsensors = i; + if (!sc->sc_nsensors) { + printf("%s: no temperature sensors found\n", DEVNAME(sc)); + return; + } + if (sensor_task_register(sc, tda_adjust, 10) == NULL) { printf("%s: unable to register update task\n", DEVNAME(sc)); return; |