common/cnxk: fix sizeof not portable

Message ID 20220424161746.1680580-1-gmuthukrishn@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series common/cnxk: fix sizeof not portable |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS

Commit Message

Gowrishankar Muthukrishnan April 24, 2022, 4:17 p.m. UTC
  Fix size of not portable issue reported in coverity scan.

Coverity issue: 376538
Fixes: 7e9a94909ee ("common/cnxk: realloc inline device XAQ AURA")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 drivers/common/cnxk/roc_nix_inl_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jerin Jacob May 5, 2022, 8:35 a.m. UTC | #1
On Sun, Apr 24, 2022 at 9:47 PM Gowrishankar Muthukrishnan
<gmuthukrishn@marvell.com> wrote:
>
> Fix size of not portable issue reported in coverity scan.
>
> Coverity issue: 376538
> Fixes: 7e9a94909ee ("common/cnxk: realloc inline device XAQ AURA")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
>  drivers/common/cnxk/roc_nix_inl_dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/roc_nix_inl_dev.c
> index 5a032aab52..8ef2bc85a3 100644
> --- a/drivers/common/cnxk/roc_nix_inl_dev.c
> +++ b/drivers/common/cnxk/roc_nix_inl_dev.c
> @@ -606,7 +606,7 @@ roc_nix_inl_dev_xaq_realloc(uint64_t aura_handle)
>         inl_dev->pkt_pools_cnt++;
>         inl_dev->pkt_pools =
>                 plt_realloc(inl_dev->pkt_pools,
> -                           sizeof(uint64_t *) * inl_dev->pkt_pools_cnt, 0);
> +                           sizeof(uint64_t) * inl_dev->pkt_pools_cnt, 0);
>         if (!inl_dev->pkt_pools)
>                 inl_dev->pkt_pools_cnt = 0;
>         else
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/roc_nix_inl_dev.c
index 5a032aab52..8ef2bc85a3 100644
--- a/drivers/common/cnxk/roc_nix_inl_dev.c
+++ b/drivers/common/cnxk/roc_nix_inl_dev.c
@@ -606,7 +606,7 @@  roc_nix_inl_dev_xaq_realloc(uint64_t aura_handle)
 	inl_dev->pkt_pools_cnt++;
 	inl_dev->pkt_pools =
 		plt_realloc(inl_dev->pkt_pools,
-			    sizeof(uint64_t *) * inl_dev->pkt_pools_cnt, 0);
+			    sizeof(uint64_t) * inl_dev->pkt_pools_cnt, 0);
 	if (!inl_dev->pkt_pools)
 		inl_dev->pkt_pools_cnt = 0;
 	else