Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sdmmc Initialise error variable to zero. If all the ...



details:   https://anonhg.NetBSD.org/src/rev/829512451930
branches:  trunk
changeset: 754484:829512451930
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Sat May 01 21:14:39 2010 +0000

description:
Initialise error variable to zero. If all the if's fail it exists the function
sdmmc_init returning the then still uninitialised variable.

gcc can't know if one of the if's is bound to happen.

Detected with -DDEBUG -DDIAGNOSTIC -DKGDB - ...

diffstat:

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

diffs (27 lines):

diff -r 4f2b7cdc2666 -r 829512451930 sys/dev/sdmmc/sdmmc_mem.c
--- a/sys/dev/sdmmc/sdmmc_mem.c Sat May 01 19:51:33 2010 +0000
+++ b/sys/dev/sdmmc/sdmmc_mem.c Sat May 01 21:14:39 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc_mem.c,v 1.4 2010/04/06 15:10:09 nonaka Exp $     */
+/*     $NetBSD: sdmmc_mem.c,v 1.5 2010/05/01 21:14:39 reinoud Exp $    */
 /*     $OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $      */
 
 /*
@@ -46,7 +46,7 @@
 /* Routines for SD/MMC memory cards. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.4 2010/04/06 15:10:09 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.5 2010/05/01 21:14:39 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -438,7 +438,7 @@
 int
 sdmmc_mem_init(struct sdmmc_softc *sc, struct sdmmc_function *sf)
 {
-       int error;
+       int error = 0;
 
        SDMMC_LOCK(sc);
 



Home | Main Index | Thread Index | Old Index