From: Yuval Mintz Date: Tue, 15 Mar 2016 17:52:04 +0000 (+0200) Subject: bnx2x: Prevent false warning for lack of FC NPIV X-Git-Tag: v4.1.12-92~119^2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=767c31172d6b3cc65b932d67942c08afd54fff76;p=users%2Fjedix%2Flinux-maple.git bnx2x: Prevent false warning for lack of FC NPIV Not all adapters have FC-NPIV configured. If bnx2fc is used with such an adapter, driver would read irrelevant data from the the nvram and log "FC-NPIV table with bad length..." In system logs. Simply accept that reading '0' as the feature offset in nvram indicates the feature isn't there and return. Reported-by: Andrew Patterson Signed-off-by: Yuval Mintz Signed-off-by: David S. Miller Orabug: 23718192 Signed-off-by: Manjunath Govindashetty --- diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index b3e5f8ac3a87f..c7abaae3099ea 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -14816,6 +14816,10 @@ static int bnx2x_get_fc_npiv(struct net_device *dev, } offset = SHMEM2_RD(bp, fc_npiv_nvram_tbl_addr[BP_PORT(bp)]); + if (!offset) { + DP(BNX2X_MSG_MCP, "No FC-NPIV in NVRAM\n"); + goto out; + } DP(BNX2X_MSG_MCP, "Offset of FC-NPIV in NVRAM: %08x\n", offset); /* Read the table contents from nvram */