Skip to content
Snippets Groups Projects
Commit b3f8a569 authored by Rohit Raj's avatar Rohit Raj Committed by Xiaobo Xie
Browse files

fsl_usdpaa: fix get link status crash


Fix crash observed in VSP while trying to get link status when link is
down from kernel.

Signed-off-by: default avatarRohit Raj <rohit.raj@nxp.com>
DPDK-3239
parent 4bbc69f2
No related branches found
No related tags found
No related merge requests found
......@@ -1849,9 +1849,13 @@ ioctl_usdpaa_get_link_status(struct usdpaa_ioctl_link_status_args *input)
if (net_dev == NULL)
return -ENODEV;
input->link_status = netif_carrier_ok(net_dev);
input->link_autoneg = net_dev->phydev->autoneg;
input->link_duplex = net_dev->phydev->duplex;
if (net_dev->phydev == NULL) { /* Interface is down from kernel */
input->link_status = ETH_LINK_DOWN;
} else {
input->link_status = netif_carrier_ok(net_dev);
input->link_autoneg = net_dev->phydev->autoneg;
input->link_duplex = net_dev->phydev->duplex;
}
if (input->link_status)
input->link_speed = net_dev->phydev->speed;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment