Module Name:    src
Committed By:   riastradh
Date:           Thu Oct  2 12:42:12 UTC 2014

Modified Files:
        src/sys/dev/acpi: acpi_bat.c

Log Message:
Don't kdassert about crap provided by the firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/dev/acpi/acpi_bat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi_bat.c
diff -u src/sys/dev/acpi/acpi_bat.c:1.112 src/sys/dev/acpi/acpi_bat.c:1.113
--- src/sys/dev/acpi/acpi_bat.c:1.112	Tue Aug 14 14:36:43 2012
+++ src/sys/dev/acpi/acpi_bat.c	Thu Oct  2 12:42:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_bat.c,v 1.112 2012/08/14 14:36:43 jruoho Exp $	*/
+/*	$NetBSD: acpi_bat.c,v 1.113 2014/10/02 12:42:12 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.112 2012/08/14 14:36:43 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.113 2014/10/02 12:42:12 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -381,7 +381,10 @@ acpibat_get_info(device_t dv)
 			goto out;
 		}
 
-		KDASSERT((uint64_t)elm[i].Integer.Value < INT_MAX);
+		if (elm[i].Integer.Value >= INT_MAX) {
+			rv = AE_LIMIT;
+			goto out;
+		}
 	}
 
 	if ((elm[ACPIBAT_BIF_UNIT].Integer.Value & ACPIBAT_PWRUNIT_MA) != 0) {

Reply via email to