From 28f71c6df4c5399e4f30ce37c1fff0f6af3d364d Mon Sep 17 00:00:00 2001 From: Hariprasad Shenai Date: Tue, 8 Mar 2016 10:50:19 +0530 Subject: [PATCH] cxgb4vf: Add a couple more checks for invalid provisioning configurations Signed-off-by: Hariprasad Shenai Signed-off-by: David S. Miller --- drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index 17a31531b26e..5a3b8836847d 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c @@ -2361,6 +2361,11 @@ static int adap_init0(struct adapter *adapter) } /* Check for various parameter sanity issues */ + if (adapter->params.vfres.pmask == 0) { + dev_err(adapter->pdev_dev, "no port access configured\n" + "usable!\n"); + return -EINVAL; + } if (adapter->params.vfres.nvi == 0) { dev_err(adapter->pdev_dev, "no virtual interfaces configured/" "usable!\n"); -- 2.34.1