diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-12-02 23:41:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-03 20:33:21 +0300 |
commit | 091056b2ad04df09a3cb78a4c4ea098709b98eb3 (patch) | |
tree | f5772aa434447bce309568e90f8767514c938d20 /drivers/net/qlcnic | |
parent | 97319a270da37a5eab14a770f1417d8229245270 (diff) | |
download | linux-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/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 08d4b37f246c..4e8466b326af 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: |