Patchwork [31/33] sfc: Use kzalloc() to ensure struct efx_spi_device is fully initialised

login
register
mail settings
Submitter Ben Hutchings
Date Dec. 12, 2008, 1 p.m.
Message ID <20081212130029.GE10372@solarflare.com>
Download mbox | patch
Permalink /patch/13735/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ben Hutchings - Dec. 12, 2008, 1 p.m.
Currently the mtd field is not initialised early enough.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/falcon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
David Miller - Dec. 13, 2008, 6:09 a.m.
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 12 Dec 2008 13:00:30 +0000

> Currently the mtd field is not initialised early enough.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 63414ce..e09a01d 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -2701,7 +2701,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;