sfc: support for devlink port requires MAE access
On systems without MAE permission efx->mae is not initialised,
and trying to lookup an mport results in a NULL pointer
dereference.
Fixes: 25414b2a64
("sfc: add devlink port support for ef100")
Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
56f66ce1fd
commit
915057ae79
|
@ -626,6 +626,9 @@ static struct devlink_port *ef100_set_devlink_port(struct efx_nic *efx, u32 idx)
|
|||
u32 id;
|
||||
int rc;
|
||||
|
||||
if (!efx->mae)
|
||||
return NULL;
|
||||
|
||||
if (efx_mae_lookup_mport(efx, idx, &id)) {
|
||||
/* This should not happen. */
|
||||
if (idx == MAE_MPORT_DESC_VF_IDX_NULL)
|
||||
|
|
Loading…
Reference in New Issue