Skip to content

Commit

Permalink
net/iavf: fix memory leak in large VF
Browse files Browse the repository at this point in the history
[ upstream commit 20aa3a8 ]

This patch fixed the issue that the memory allocated for structure
virtchnl_del_ena_dis_queues is not released at the end of the functions
iavf_enable_queues_lv, iavf_disable_queues_lv and iavf_switch_queue_lv.

Fixes: 9cf9c02 ("net/iavf: add enable/disable queues for large VF")

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
tingxu1 authored and bluca committed Feb 2, 2021
1 parent e97bb2a commit 2cbc618
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions drivers/net/iavf/iavf_vchnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,12 @@ iavf_enable_queues_lv(struct iavf_adapter *adapter)
args.out_buffer = vf->aq_resp;
args.out_size = IAVF_AQ_BUF_SZ;
err = iavf_execute_vf_cmd(adapter, &args);
if (err) {
if (err)
PMD_DRV_LOG(ERR,
"Failed to execute command of OP_ENABLE_QUEUES_V2");
return err;
}
return 0;

rte_free(queue_select);
return err;
}

int
Expand Down Expand Up @@ -688,12 +688,12 @@ iavf_disable_queues_lv(struct iavf_adapter *adapter)
args.out_buffer = vf->aq_resp;
args.out_size = IAVF_AQ_BUF_SZ;
err = iavf_execute_vf_cmd(adapter, &args);
if (err) {
if (err)
PMD_DRV_LOG(ERR,
"Failed to execute command of OP_DISABLE_QUEUES_V2");
return err;
}
return 0;

rte_free(queue_select);
return err;
}

int
Expand Down Expand Up @@ -737,6 +737,8 @@ iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid,
if (err)
PMD_DRV_LOG(ERR, "Failed to execute command of %s",
on ? "OP_ENABLE_QUEUES_V2" : "OP_DISABLE_QUEUES_V2");

rte_free(queue_select);
return err;
}

Expand Down

0 comments on commit 2cbc618

Please sign in to comment.