summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-04-06 13:54:35 +0100
committerDavid S. Miller <davem@davemloft.net>2017-04-08 08:15:34 -0700
commit1f1120a5427c9e7894be63baaab828755e45a1c0 (patch)
tree1ab2928ee6a71dda5cb4ef0222d14d7a7649d98d
parent7cb164ef5b47b2e947d8361f6f2cd4823ff01557 (diff)
downloadlinux-1f1120a5427c9e7894be63baaab828755e45a1c0.tar.bz2
nfp: don't dereference a null nn->eth_port to print a warning
On the case where nn->eth_port is null the warning message is printing the port by dereferencing this null pointer. Remove the deference to avoid a crash when printing the warning message. Detected by CoverityScan, CID#1426198 ("Dereference after null check") Fixes: ce22f5a2cbe3c627 ("nfp: separate high level and low level NSP headers") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
index 3e1f97e88710..4c6863a072d3 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
@@ -495,8 +495,7 @@ static void nfp_net_refresh_netdevs(struct work_struct *work)
list_for_each_entry_safe(nn, next, &pf->ports, port_list) {
if (!nn->eth_port) {
- nfp_warn(pf->cpp, "Warning: port %d not present after reconfig\n",
- nn->eth_port->eth_index);
+ nfp_warn(pf->cpp, "Warning: port not present after reconfig\n");
continue;
}
if (!nn->eth_port->override_changed)