提交 1f1120a5 编写于 作者: C Colin Ian King 提交者: David S. Miller

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: ce22f5a2 ("nfp: separate high level and low level NSP headers")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7cb164ef
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册