[09/10] net/ixgbe/base: add missing buffer copy
Checks
Commit Message
From: Dan Nowlin <dan.nowlin@intel.com>
Add missing buffer copy in ixgbe_aci_send_cmd_sc().
In ixgbe_aci_send_cmd_sc() there is code to retry aq commands for
certain commands. To achieve this the function makes a copy of the
original ixgbe_aci_desc structure and allocates memory to store an
original copy of the command buffer. This allows the original structure
and buffer to be restored before attempting the command again. However,
the function didn't perform the actual copy of the original command
buffer into the copy buffer.
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
---
drivers/net/ixgbe/base/ixgbe_e610.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Tue, Jan 14, 2025 at 06:10:19PM +0800, Yuan Wang wrote:
> From: Dan Nowlin <dan.nowlin@intel.com>
>
> Add missing buffer copy in ixgbe_aci_send_cmd_sc().
>
> In ixgbe_aci_send_cmd_sc() there is code to retry aq commands for
> certain commands. To achieve this the function makes a copy of the
> original ixgbe_aci_desc structure and allocates memory to store an
> original copy of the command buffer. This allows the original structure
> and buffer to be restored before attempting the command again. However,
> the function didn't perform the actual copy of the original command
> buffer into the copy buffer.
>
> Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
> Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
> ---
> drivers/net/ixgbe/base/ixgbe_e610.c | 1 +
> 1 file changed, 1 insertion(+)
>
Fixes: 25b48e569f2f ("net/ixgbe/base: add E610 Admin Command Interface")
Cc: stable@dpdk.org
@@ -282,6 +282,7 @@ s32 ixgbe_aci_send_cmd(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
buf_cpy = (u8 *)ixgbe_malloc(hw, buf_size);
if (!buf_cpy)
return IXGBE_ERR_OUT_OF_MEM;
+ memcpy(buf_cpy, buf, buf_size);
}
memcpy(&desc_cpy, desc, sizeof(desc_cpy));
}