sfc: Use kzalloc() to ensure struct efx_spi_device is fully initialised
[firefly-linux-kernel-4.4.55.git] / drivers / net / sfc / falcon.c
index df844defc0a997fedf7fefa239ca4f66a608f472..6884dc8c1f8259a69421a65b7a1f81df8ff57a97 100644 (file)
@@ -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;