瀏覽代碼

cxgb4vf: Add a couple more checks for invalid provisioning configurations

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Hariprasad Shenai 9 年之前
父節點
當前提交
28f71c6df4
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

+ 5 - 0
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");