Skip to content

Commit

Permalink
common/iavf: fix ARQ resource leak
Browse files Browse the repository at this point in the history
[ upstream commit 395d41f ]

In the iavf_init_arq function, if an exception occurs in the
iavf_config_arq_regs function, and the previously applied ARQ (Admin
Receive Queue) bufs resource is released. This patch maintains the same
modification as the iavf_init_asq function to roll back resources.

Fixes: 87aca6d ("net/iavf/base: fix command buffer memory leak")

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Qiming Chen authored and cpaelzer committed Nov 30, 2021
1 parent 70146f4 commit 18d35ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/iavf/base/iavf_adminq.c
Expand Up @@ -431,14 +431,18 @@ enum iavf_status_code iavf_init_arq(struct iavf_hw *hw)
/* initialize base registers */
ret_code = iavf_config_arq_regs(hw);
if (ret_code != IAVF_SUCCESS)
goto init_adminq_free_rings;
goto init_config_regs;

/* success! */
hw->aq.arq.count = hw->aq.num_arq_entries;
goto init_adminq_exit;

init_adminq_free_rings:
iavf_free_adminq_arq(hw);
return ret_code;

init_config_regs:
iavf_free_arq_bufs(hw);

init_adminq_exit:
return ret_code;
Expand Down

0 comments on commit 18d35ae

Please sign in to comment.