diff options
author | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2014-11-04 18:29:33 +0000 |
---|---|---|
committer | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2014-11-04 18:29:33 +0000 |
commit | 3762150417f420fca9f46d2aa542db616c90be61 (patch) | |
tree | 14ed5e1e7cb8865d87bc0e2be5a97fa4e6ed00b3 /sys/kern | |
parent | e4207c62ae737d5e1f32ab32535a271983cfd109 (diff) |
panic when a sensordev gets installed twice, instead of blowing up amazingly
later on
ok deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sensors.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_sensors.c b/sys/kern/kern_sensors.c index 22855ed4886..0914bb0b7c3 100644 --- a/sys/kern/kern_sensors.c +++ b/sys/kern/kern_sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sensors.c,v 1.30 2014/11/01 23:58:28 tedu Exp $ */ +/* $OpenBSD: kern_sensors.c,v 1.31 2014/11/04 18:29:32 jasper Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -50,7 +50,7 @@ sensordev_install(struct ksensordev *sensdev) for (v = SLIST_FIRST(&sensordev_list); (nv = SLIST_NEXT(v, list)) != NULL; v = nv) if (nv->num - v->num > 1) - break; + panic("sensor installed twice"); sensdev->num = v->num + 1; SLIST_INSERT_AFTER(v, sensdev, list); } |