History

ionic: check port ptr before use

Check for corner case of port_init failure before using the port_info pointer.

Shannon Nelson committed 6 years ago

Commit 2bcbf421 parent 2aaf09a1 file · +5 −0Browse files

Unified · Split

drivers/net/ethernet/pensando/ionic/ionic_ethtool.c+5−0
@@ -126,6 +126,11 @@ static int ionic_get_link_ksettings(struct net_device *netdev, · 125 unmodified lines
126 126
127 ethtool_link_ksettings_zero_link_mode(ks, supported);127 ethtool_link_ksettings_zero_link_mode(ks, supported);
128 128
129 if (!idev->port_info) {
130 netdev_err(netdev, "port_info not initialized\n");
131 return -EOPNOTSUPP;
132 }
133
129 /* The port_info data is found in a DMA space that the NIC keeps134 /* The port_info data is found in a DMA space that the NIC keeps
130 * up-to-date, so there's no need to request the data from the135 * up-to-date, so there's no need to request the data from the
131 * NIC, we already have it in our memory space.136 * NIC, we already have it in our memory space.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t