]> git.sur5r.net Git - u-boot/commitdiff
mmc: Fix uninitialised priv member
authorAlex Kiernan <alex.kiernan@gmail.com>
Fri, 9 Feb 2018 15:24:38 +0000 (15:24 +0000)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 19 Feb 2018 08:00:33 +0000 (17:00 +0900)
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>
drivers/mmc/omap_hsmmc.c

index 24027f2b34797fcca86ef9e1977fdb049ad7db13..02970f29b295787a248e530884fee18cbbdb7b69 100644 (file)
@@ -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;
        uint host_caps_val;
 
-       priv = malloc(sizeof(*priv));
+       priv = calloc(1, sizeof(*priv));
        if (priv == NULL)
                return -1;