net/sfc/base: prevent access to the NIC config before probe
authorMark Spender <mspender@solarflare.com>
Mon, 10 Sep 2018 09:33:26 +0000 (10:33 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 27 Sep 2018 23:41:02 +0000 (01:41 +0200)
NIC config is initialized during NIC probe.

Fixes: 19b64c6ac35f ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org
Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/base/efx_nic.c

index e5cb010..cea32b7 100644 (file)
@@ -595,6 +595,7 @@ efx_nic_cfg_get(
        __in            efx_nic_t *enp)
 {
        EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+       EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
 
        return (&(enp->en_nic_cfg));
 }