public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 1/4] exynos: Properly zero initialize host in s5p_sdhci_init()
@ 2015-10-05 11:47 Tobias Jakobi
  2015-10-05 11:47 ` [U-Boot] [PATCH v3 2/4] exynos: Fix passing of errors in exynos_mmc_init() Tobias Jakobi
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Tobias Jakobi @ 2015-10-05 11:47 UTC (permalink / raw)
  To: u-boot

This makes sure that setting the host_caps in s5p_sdhci_core_init()
doesn't operate on potentially uninitialized memory.

Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/mmc/s5p_sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 4db51d6..911e7a8 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -84,9 +84,9 @@ static int s5p_sdhci_core_init(struct sdhci_host *host)
 
 int s5p_sdhci_init(u32 regbase, int index, int bus_width)
 {
-	struct sdhci_host *host = malloc(sizeof(struct sdhci_host));
+	struct sdhci_host *host = calloc(1, sizeof(struct sdhci_host));
 	if (!host) {
-		printf("sdhci__host malloc fail!\n");
+		printf("sdhci__host allocation fail!\n");
 		return 1;
 	}
 	host->ioaddr = (void *)regbase;
-- 
2.0.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-10-28 14:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 11:47 [U-Boot] [PATCH v3 1/4] exynos: Properly zero initialize host in s5p_sdhci_init() Tobias Jakobi
2015-10-05 11:47 ` [U-Boot] [PATCH v3 2/4] exynos: Fix passing of errors in exynos_mmc_init() Tobias Jakobi
2015-10-13 11:52   ` Minkyu Kang
2015-10-05 11:47 ` [U-Boot] [PATCH v3 3/4] exynos: be more verbose in process_nodes() Tobias Jakobi
2015-10-13 11:52   ` Minkyu Kang
2015-10-05 11:47 ` [U-Boot] [PATCH v3 4/4] exynos: more debug and cleanup in do_sdhci_init() Tobias Jakobi
2015-10-13 11:52   ` Minkyu Kang
2015-10-28  6:33   ` Jaehoon Chung
2015-10-28 11:33     ` Przemyslaw Marczak
2015-10-28 12:30       ` Jaehoon Chung
2015-10-28 13:46         ` Przemyslaw Marczak
2015-10-28 14:36           ` Jaehoon Chung
2015-10-28 14:48             ` Przemyslaw Marczak
2015-10-13 11:51 ` [U-Boot] [PATCH v3 1/4] exynos: Properly zero initialize host in s5p_sdhci_init() Minkyu Kang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox