mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
sfc: Use kzalloc() to ensure struct efx_spi_device is fully initialised
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>
This commit is contained in:
parent
fa402b2ea9
commit
0c53d8c840
1 changed files with 1 additions and 1 deletions
|
@ -2690,7 +2690,7 @@ static int falcon_spi_device_init(struct efx_nic *efx,
|
||||||
struct efx_spi_device *spi_device;
|
struct efx_spi_device *spi_device;
|
||||||
|
|
||||||
if (device_type != 0) {
|
if (device_type != 0) {
|
||||||
spi_device = kmalloc(sizeof(*spi_device), GFP_KERNEL);
|
spi_device = kzalloc(sizeof(*spi_device), GFP_KERNEL);
|
||||||
if (!spi_device)
|
if (!spi_device)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
spi_device->device_id = device_id;
|
spi_device->device_id = device_id;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue