summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit.salecha@qlogic.com>2010-12-02 20:41:43 (GMT)
committerDavid S. Miller <davem@davemloft.net>2010-12-03 17:33:21 (GMT)
commit091056b2ad04df09a3cb78a4c4ea098709b98eb3 (patch)
treef5772aa434447bce309568e90f8767514c938d20 /drivers/net
parent97319a270da37a5eab14a770f1417d8229245270 (diff)
downloadlinux-fsl-qoriq-091056b2ad04df09a3cb78a4c4ea098709b98eb3.tar.xz
qlcnic: validate eswitch config values for PF
Currently driver set default eswitch configuration values for PF function, instead of validating values sent by application. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 08d4b37..4e8466b 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -3537,9 +3537,12 @@ validate_esw_config(struct qlcnic_adapter *adapter,
case QLCNIC_PORT_DEFAULTS:
if (QLC_DEV_GET_DRV(op_mode, pci_func) !=
QLCNIC_NON_PRIV_FUNC) {
- esw_cfg[i].mac_anti_spoof = 0;
- esw_cfg[i].mac_override = 1;
- esw_cfg[i].promisc_mode = 1;
+ if (esw_cfg[i].mac_anti_spoof != 0)
+ return QL_STATUS_INVALID_PARAM;
+ if (esw_cfg[i].mac_override != 1)
+ return QL_STATUS_INVALID_PARAM;
+ if (esw_cfg[i].promisc_mode != 1)
+ return QL_STATUS_INVALID_PARAM;
}
break;
case QLCNIC_ADD_VLAN: