diff options
author | Chenmin Sun <chenmin.sun@intel.com> | 2021-03-30 03:50:02 +0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-03-30 09:40:03 +0000 |
commit | 0b37034fef436e02dd739b3b2c05f03708229e4c (patch) | |
tree | e2798e27bc2ed78e2a09a12fdd2305b74532a2e7 /src/plugins/avf/avf_fdir_lib.c | |
parent | 9bf487fb45eb31c65c03453b348a34a2b3a863f9 (diff) |
avf: fix coverity issues
CID #220403 ~ 220406
Type: fix
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ibb65f9f2b17b9a9d45c077933b033ca3a65ae42f
Diffstat (limited to 'src/plugins/avf/avf_fdir_lib.c')
-rw-r--r-- | src/plugins/avf/avf_fdir_lib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/avf/avf_fdir_lib.c b/src/plugins/avf/avf_fdir_lib.c index 44c10dc7388..f38614e87ec 100644 --- a/src/plugins/avf/avf_fdir_lib.c +++ b/src/plugins/avf/avf_fdir_lib.c @@ -73,7 +73,7 @@ avf_fdir_rcfg_set_hdr (struct avf_fdir_conf *rcfg, int layer, struct virtchnl_proto_hdrs *hdrs; hdrs = &rcfg->add_fltr.rule_cfg.proto_hdrs; - if (layer > VIRTCHNL_MAX_NUM_PROTO_HDRS) + if (layer >= VIRTCHNL_MAX_NUM_PROTO_HDRS) return -1; hdrs->proto_hdr[layer].type = hdr; @@ -486,7 +486,7 @@ int avf_fdir_rcfg_act_queue (struct avf_fdir_conf *rcfg, int queue, int size, int act_idx) { - if (act_idx > VIRTCHNL_MAX_NUM_ACTIONS) + if (act_idx >= VIRTCHNL_MAX_NUM_ACTIONS) return -AVF_FAILURE; struct virtchnl_filter_action *filter_action; @@ -565,7 +565,7 @@ avf_fdir_rcfg_act_drop (struct avf_fdir_conf *rcfg, int act_idx) { struct virtchnl_filter_action *filter_action; - if (act_idx > VIRTCHNL_MAX_NUM_ACTIONS) + if (act_idx >= VIRTCHNL_MAX_NUM_ACTIONS) return -AVF_FAILURE; filter_action = rcfg->add_fltr.rule_cfg.action_set.actions + act_idx; @@ -579,7 +579,7 @@ avf_fdir_rcfg_act_mark (struct avf_fdir_conf *rcfg, const u32 mark, int act_idx) { struct virtchnl_filter_action *filter_action; - if (act_idx > VIRTCHNL_MAX_NUM_ACTIONS) + if (act_idx >= VIRTCHNL_MAX_NUM_ACTIONS) return -AVF_FAILURE; filter_action = rcfg->add_fltr.rule_cfg.action_set.actions + act_idx; |