sandbox: mmc: Start off with a zeroed file
When running multiple tests the mmc emulator calls malloc() to obtain the memory for its disk image. Since the memory is not cleared, it is possible that it happens to contain a partition table. The dm_test_part() test (for one) relies on mmc0 being empty on startup. Zero the memory to ensure that it is. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
3f23ce2b6c
commit
67bb973122
1 changed files with 1 additions and 1 deletions
|
@ -183,7 +183,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);
|
||||
|
|
Loading…
Reference in a new issue