Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 25414b2a64ae ("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>

authored by

Martin Habets and committed by
Jakub Kicinski
915057ae 56f66ce1

+3
+3
drivers/net/ethernet/sfc/efx_devlink.c
··· 626 626 u32 id; 627 627 int rc; 628 628 629 + if (!efx->mae) 630 + return NULL; 631 + 629 632 if (efx_mae_lookup_mport(efx, idx, &id)) { 630 633 /* This should not happen. */ 631 634 if (idx == MAE_MPORT_DESC_VF_IDX_NULL)