From 3deb5ba1e11bcba8a61efd855bfd8e9f58427a31 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 22 Apr 2015 04:02:06 +0000 Subject: [PATCH] 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. --- sys/dev/sdmmc/sdmmc_mem.c | 6 +++--- 1 file 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 @@ -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++) { -- 2.20.1