Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/dev Initialise ret to avoid returning uninit...



details:   https://anonhg.NetBSD.org/src/rev/1c79a5e52a61
branches:  trunk
changeset: 321289:1c79a5e52a61
user:      sevan <sevan%NetBSD.org@localhost>
date:      Fri Mar 09 11:05:56 2018 +0000

description:
Initialise ret to avoid returning uninitialised value if the if statement is
false. Found when building the POWERMAC_G5 kernel with clang.

diffstat:

 sys/arch/macppc/dev/smu.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r bc6e608f120b -r 1c79a5e52a61 sys/arch/macppc/dev/smu.c
--- a/sys/arch/macppc/dev/smu.c Fri Mar 09 11:05:21 2018 +0000
+++ b/sys/arch/macppc/dev/smu.c Fri Mar 09 11:05:56 2018 +0000
@@ -710,6 +710,7 @@
 smu_fan_get_rpm(struct smu_fan *fan, int *rpm)
 {
        int ret;
+       ret = 0;
 
        if (time_uptime - fan->last_update > 1) {
                ret = smu_fan_update_rpm(fan);



Home | Main Index | Thread Index | Old Index