Skip to content

Commit

Permalink
sfc: Use kzalloc() to ensure struct efx_spi_device is fully initialised
Browse files Browse the repository at this point in the history
Currently the mtd field is not initialised early enough.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Dec 13, 2008
1 parent fa402b2 commit 0c53d8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0c53d8c

Please sign in to comment.