Module Name: src
Committed By: reinoud
Date: Sat May 1 21:14:40 UTC 2010
Modified Files:
src/sys/dev/sdmmc: sdmmc_mem.c
Log Message:
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 - ...
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/sdmmc/sdmmc_mem.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/sdmmc/sdmmc_mem.c
diff -u src/sys/dev/sdmmc/sdmmc_mem.c:1.4 src/sys/dev/sdmmc/sdmmc_mem.c:1.5
--- src/sys/dev/sdmmc/sdmmc_mem.c:1.4 Tue Apr 6 15:10:09 2010
+++ src/sys/dev/sdmmc/sdmmc_mem.c Sat May 1 21:14:39 2010
@@ -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);