mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
net: sxgbe: Fix NULL dereferece when using DT
When the MAC address is provided in the device tree file, the condition is true and kernel crashes due to NULL dereference. Signed-off-by: Girish K.S <[email protected]> Signed-off-by: Byungho An <[email protected]> Signed-off-by: Kukjin Kim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
01fbd3f55c
commit
1c1832c7cd
1 changed files with 4 additions and 4 deletions
|
|
@ -108,10 +108,6 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
|
|||
}
|
||||
}
|
||||
|
||||
/* Get MAC address if available (DT) */
|
||||
if (mac)
|
||||
ether_addr_copy(priv->dev->dev_addr, mac);
|
||||
|
||||
priv = sxgbe_drv_probe(&(pdev->dev), plat_dat, addr);
|
||||
if (!priv) {
|
||||
pr_err("%s: main driver probe failed\n", __func__);
|
||||
|
|
@ -125,6 +121,10 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
|
|||
goto err_drv_remove;
|
||||
}
|
||||
|
||||
/* Get MAC address if available (DT) */
|
||||
if (mac)
|
||||
ether_addr_copy(priv->dev->dev_addr, mac);
|
||||
|
||||
/* Get the TX/RX IRQ numbers */
|
||||
for (i = 0, chan = 1; i < SXGBE_TX_QUEUES; i++) {
|
||||
priv->txq[i]->irq_no = irq_of_parse_and_map(node, chan++);
|
||||
|
|
|
|||
Loading…
Reference in a new issue