From: Amit Kumar Salecha Date: Thu, 2 Dec 2010 20:41:43 +0000 (+0000) Subject: qlcnic: validate eswitch config values for PF X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=091056b2ad04df09a3cb78a4c4ea098709b98eb3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Anirban Chakraborty Signed-off-by: David S. Miller --- 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: