提交 0c53d8c8 编写于 作者: B Ben Hutchings 提交者: 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: NBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册