Skip to content

Commit 2aad7d4

Browse files
IoanaCiorneikuba-moo
authored andcommitted
dpaa2-switch: fix size of the dma_unmap
The size of the DMA unmap was wrongly put as a sizeof of a pointer. Change the value of the DMA unmap to be the actual macro used for the allocation and the DMA map. Fixes: 1110318 ("dpaa2-switch: add tc flower hardware offload on ingress traffic") Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Link: https://lore.kernel.org/r/20231212164326.2753457-2-ioana.ciornei@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 23d05d5 commit 2aad7d4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ int dpaa2_switch_acl_entry_add(struct dpaa2_switch_filter_block *filter_block,
139139
err = dpsw_acl_add_entry(ethsw->mc_io, 0, ethsw->dpsw_handle,
140140
filter_block->acl_id, acl_entry_cfg);
141141

142-
dma_unmap_single(dev, acl_entry_cfg->key_iova, sizeof(cmd_buff),
142+
dma_unmap_single(dev, acl_entry_cfg->key_iova,
143+
DPAA2_ETHSW_PORT_ACL_CMD_BUF_SIZE,
143144
DMA_TO_DEVICE);
144145
if (err) {
145146
dev_err(dev, "dpsw_acl_add_entry() failed %d\n", err);
@@ -181,8 +182,8 @@ dpaa2_switch_acl_entry_remove(struct dpaa2_switch_filter_block *block,
181182
err = dpsw_acl_remove_entry(ethsw->mc_io, 0, ethsw->dpsw_handle,
182183
block->acl_id, acl_entry_cfg);
183184

184-
dma_unmap_single(dev, acl_entry_cfg->key_iova, sizeof(cmd_buff),
185-
DMA_TO_DEVICE);
185+
dma_unmap_single(dev, acl_entry_cfg->key_iova,
186+
DPAA2_ETHSW_PORT_ACL_CMD_BUF_SIZE, DMA_TO_DEVICE);
186187
if (err) {
187188
dev_err(dev, "dpsw_acl_remove_entry() failed %d\n", err);
188189
kfree(cmd_buff);

0 commit comments

Comments
 (0)