]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
cxgb4vf: Add a couple more checks for invalid provisioning configurations
authorHariprasad Shenai <hariprasad@chelsio.com>
Tue, 8 Mar 2016 05:20:19 +0000 (10:50 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Mar 2016 21:12:25 +0000 (16:12 -0500)
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

index 17a31531b26e1073ce07a54f92a3200b48845593..5a3b8836847d8671f6a9a01be0f4d23f9efdfc97 100644 (file)
@@ -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");