Commit 0c53d8c8 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

sfc: Use kzalloc() to ensure struct efx_spi_device is fully initialised

Currently the mtd field is not initialised early enough.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fa402b2e
......@@ -2690,7 +2690,7 @@ static int falcon_spi_device_init(struct efx_nic *efx,
struct efx_spi_device *spi_device;
if (device_type != 0) {
spi_device = kmalloc(sizeof(*spi_device), GFP_KERNEL);
spi_device = kzalloc(sizeof(*spi_device), GFP_KERNEL);
if (!spi_device)
return -ENOMEM;
spi_device->device_id = device_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment