On 3/31/22 01:54, Sean Anderson wrote:
> Private data is initialized to all zeros by DM. Malloc does not do this.
> Initialize it. This fixes partition detection logic from trying to detect
> partitions in uninitialized memory.
> 
> Fixes: 0bf61aced2 ("sandbox: mmc: Support a backing file")
> Signed-off-by: Sean Anderson <[email protected]>

Reviewed-by: Jaehoon Chung <[email protected]>


Best Regards,
Jaehoon Chung

> ---
> 
>  drivers/mmc/sandbox_mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/sandbox_mmc.c b/drivers/mmc/sandbox_mmc.c
> index 35159451e1..60a6be0add 100644
> --- a/drivers/mmc/sandbox_mmc.c
> +++ b/drivers/mmc/sandbox_mmc.c
> @@ -178,7 +178,7 @@ static int sandbox_mmc_probe(struct udevice *dev)
>               priv->csize = 0;
>               priv->size = (priv->csize + 1) * SIZE_MULTIPLE; /* 1 MiB */
>  
> -             priv->buf = malloc(priv->size);
> +             priv->buf = calloc(1, priv->size);
>               if (!priv->buf) {
>                       log_err("%s: Not enough memory (%x bytes)\n",
>                               dev->name, priv->size);

Reply via email to