Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;