diff options
Diffstat (limited to 'drivers/mtd/spi/sf_probe.c')
| -rw-r--r-- | drivers/mtd/spi/sf_probe.c | 3 | 
1 files changed, 1 insertions, 2 deletions
| diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index bc3cf6cc6..e84ab1363 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -123,12 +123,11 @@ static struct spi_flash *spi_flash_validate_params(struct spi_slave *spi,  		return NULL;  	} -	flash = malloc(sizeof(*flash)); +	flash = calloc(1, sizeof(*flash));  	if (!flash) {  		debug("SF: Failed to allocate spi_flash\n");  		return NULL;  	} -	memset(flash, '\0', sizeof(*flash));  	/* Assign spi data */  	flash->spi = spi; |