net/sfc: avoid usage of possibly uninitialized link mode

In fact efx_port_poll() always initializes it, but it isn't
explicitly documented feature of the API. Moreover, the API
annocation suggests that return code should be checked.

Fixes: 886f8d8a05 ("net/sfc: retrieve link info")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
This commit is contained in:
Andrew Rybchenko 2017-01-12 09:03:20 +00:00 committed by Ferruh Yigit
parent 16994abee2
commit c7c915e1e3

View File

@ -198,7 +198,8 @@ sfc_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
if (wait_to_complete) {
efx_link_mode_t link_mode;
efx_port_poll(sa->nic, &link_mode);
if (efx_port_poll(sa->nic, &link_mode) != 0)
link_mode = EFX_LINK_UNKNOWN;
sfc_port_link_mode_to_info(link_mode, &current_link);
if (!rte_atomic64_cmpset((volatile uint64_t *)dev_link,