Skip to content

Commit

Permalink
cxgb4vf: Add a couple more checks for invalid provisioning configurat…
Browse files Browse the repository at this point in the history
…ions

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hariprasad Shenai authored and David S. Miller committed Mar 10, 2016
1 parent 495c22b commit 28f71c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 28f71c6

Please sign in to comment.