mmc: Fix uninitialised priv member
authorAlex Kiernan <[email protected]>
Fri, 9 Feb 2018 15:24:38 +0000 (15:24 +0000)
committerJaehoon Chung <[email protected]>
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 <[email protected]>
Tested-by: Robert Nelson <[email protected]>
Reviewed-by: Sam Protsenko <[email protected]>
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;