From 3762150417f420fca9f46d2aa542db616c90be61 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Tue, 4 Nov 2014 18:29:33 +0000 Subject: panic when a sensordev gets installed twice, instead of blowing up amazingly later on ok deraadt@ --- sys/kern/kern_sensors.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern') 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 @@ -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); } -- cgit v1.2.3