Commit 13894ce7 authored by Stefan Wahren's avatar Stefan Wahren Committed by Kamal Mostafa

net: qca_spi: Fix possible race during probe

commit 268be0f7 upstream.

Registering the netdev before setting the priv data is unsafe.
So fix this possible race by setting the priv data first.
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Fixes: 291ab06e (net: qualcomm: new Ethernet over SPI driver for QCA7000)
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 37add483
......@@ -913,6 +913,8 @@ qca_spi_probe(struct spi_device *spi_device)
qca->spi_dev = spi_device;
qca->legacy_mode = legacy_mode;
spi_set_drvdata(spi_device, qcaspi_devs);
mac = of_get_mac_address(spi_device->dev.of_node);
if (mac)
......@@ -945,8 +947,6 @@ qca_spi_probe(struct spi_device *spi_device)
return -EFAULT;
}
spi_set_drvdata(spi_device, qcaspi_devs);
qcaspi_init_device_debugfs(qca);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment