Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Do not use uninitialized level if fujitsu_bp_ge...



details:   https://anonhg.NetBSD.org/src/rev/fc2766a1d424
branches:  trunk
changeset: 778083:fc2766a1d424
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Mar 15 16:19:02 2012 +0000

description:
Do not use uninitialized level if fujitsu_bp_get_brightness() returned
an error; from gcc -O3 (completely harmless in this case though).

diffstat:

 sys/dev/acpi/fujbp_acpi.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r e841dca86fc2 -r fc2766a1d424 sys/dev/acpi/fujbp_acpi.c
--- a/sys/dev/acpi/fujbp_acpi.c Thu Mar 15 16:17:48 2012 +0000
+++ b/sys/dev/acpi/fujbp_acpi.c Thu Mar 15 16:19:02 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fujbp_acpi.c,v 1.1 2011/02/20 08:31:46 jruoho Exp $ */
+/*     $NetBSD: fujbp_acpi.c,v 1.2 2012/03/15 16:19:02 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fujbp_acpi.c,v 1.1 2011/02/20 08:31:46 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fujbp_acpi.c,v 1.2 2012/03/15 16:19:02 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -437,12 +437,12 @@
 
        mutex_enter(&sc->sc_mtx);
        error = fujitsu_bp_get_brightness(sc, &level);
-       val = (int)level;
        mutex_exit(&sc->sc_mtx);
 
        if (error)
                return error;
 
+       val = (int)level;
        node.sysctl_data = &val;
        error = sysctl_lookup(SYSCTLFN_CALL(&node));
        if (error || newp == NULL)



Home | Main Index | Thread Index | Old Index