Commit 0a03f3c5 authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller

octeon_ep: fix error return code in octep_probe()

If register_netdev() fails , it should return error
code in octep_probe().

Fixes: 862cd659 ("octeon_ep: Add driver framework and device initialization")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 48b48b65
...@@ -1071,7 +1071,8 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1071,7 +1071,8 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
octep_get_mac_addr(octep_dev, octep_dev->mac_addr); octep_get_mac_addr(octep_dev, octep_dev->mac_addr);
eth_hw_addr_set(netdev, octep_dev->mac_addr); eth_hw_addr_set(netdev, octep_dev->mac_addr);
if (register_netdev(netdev)) { err = register_netdev(netdev);
if (err) {
dev_err(&pdev->dev, "Failed to register netdev\n"); dev_err(&pdev->dev, "Failed to register netdev\n");
goto register_dev_err; goto register_dev_err;
} }
......
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