summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-04-22 04:02:07 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-04-22 04:02:07 +0000
commitb52875f8db6584275a1d1c4077ea0dbe2bc9f2ef (patch)
tree22b601f604886398d530b3c21a60ba8512dc9ead
parentcae43cc1a2aee7ea5e956cfdc94fe1fc789add98 (diff)
Init error to 0 for sdmmc_mem_single_{read,write}_block
otherwise the value would be uninitialised in the unlikely case of being called with length 0.
-rw-r--r--sys/dev/sdmmc/sdmmc_mem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c
index 35002091ca7..459444e6f5f 100644
--- a/sys/dev/sdmmc/sdmmc_mem.c
+++ b/sys/dev/sdmmc/sdmmc_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc_mem.c,v 1.20 2014/09/23 12:08:13 rapha Exp $ */
+/* $OpenBSD: sdmmc_mem.c,v 1.21 2015/04/22 04:02:06 jsg Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -621,7 +621,7 @@ int
sdmmc_mem_single_read_block(struct sdmmc_function *sf, int blkno, u_char *data,
size_t datalen)
{
- int error;
+ int error = 0;
int i;
for (i = 0; i < datalen / sf->csd.sector_size; i++) {
@@ -709,7 +709,7 @@ int
sdmmc_mem_single_write_block(struct sdmmc_function *sf, int blkno, u_char *data,
size_t datalen)
{
- int error;
+ int error = 0;
int i;
for (i = 0; i < datalen / sf->csd.sector_size; i++) {