Browse Source

mmc: Fix uninitialised priv member

When using omap_hsmmc without the device model then the allocation
of mmc->priv ends up uninitialised.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Alex Kiernan 7 years ago
parent
commit
4a41fec589
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/mmc/omap_hsmmc.c

+ 1 - 1
drivers/mmc/omap_hsmmc.c

@@ -1449,7 +1449,7 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
 	struct mmc_config *cfg;
 	struct mmc_config *cfg;
 	uint host_caps_val;
 	uint host_caps_val;
 
 
-	priv = malloc(sizeof(*priv));
+	priv = calloc(1, sizeof(*priv));
 	if (priv == NULL)
 	if (priv == NULL)
 		return -1;
 		return -1;