[v1] eventdev: fix invalid memory free operation

Message ID 20230228213123.371897-1-abdullah.sevincer@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v1] eventdev: fix invalid memory free operation |

Checks

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

Commit Message

Abdullah Sevincer Feb. 28, 2023, 9:31 p.m. UTC
  This commit fixes invalid memory free operation
caused by extending xstats ID width from 32 to 64 bits.

Telemetry application crashed when freeing memory,
hence, the telemetry app could not display xstats.

Fixes: 1bdfe4d76e98 ("eventdev: increase xstats ID width to 64 bits")
Cc: stable@dpdk.org

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
---
 lib/eventdev/rte_eventdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jerin Jacob March 3, 2023, 3:55 p.m. UTC | #1
On Wed, Mar 1, 2023 at 3:01 AM Abdullah Sevincer
<abdullah.sevincer@intel.com> wrote:
>
> This commit fixes invalid memory free operation
> caused by extending xstats ID width from 32 to 64 bits.
>
> Telemetry application crashed when freeing memory,
> hence, the telemetry app could not display xstats.
>
> Fixes: 1bdfe4d76e98 ("eventdev: increase xstats ID width to 64 bits")
> Cc: stable@dpdk.org
>
> Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>

Looks good to me.

Acked-by: Jerin Jacob <jerinj@marvell.com>


Updated the git commit as follows and applied to
dpdk-next-net-eventdev/for-main. Thanks


    eventdev: fix invalid memory free operation

    Fixe the invalid memory free operation caused by extending
    xstats ID width from 32 to 64 bits.

    Telemetry application crashed when freeing memory,
    hence, the telemetry app could not display xstats.

    Fixes: 1bdfe4d76e98 ("eventdev: increase xstats ID width to 64 bits")
    Cc: stable@dpdk.org

    Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
    Acked-by: Jerin Jacob <jerinj@marvell.com>
> ---
>  lib/eventdev/rte_eventdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> index 71a29f3506..6ab4524332 100644
> --- a/lib/eventdev/rte_eventdev.c
> +++ b/lib/eventdev/rte_eventdev.c
> @@ -1725,7 +1725,7 @@ eventdev_build_telemetry_data(int dev_id,
>         if (xstat_names == NULL)
>                 return -1;
>
> -       ids = malloc((sizeof(unsigned int)) * num_xstats);
> +       ids = malloc((sizeof(uint64_t)) * num_xstats);
>         if (ids == NULL) {
>                 free(xstat_names);
>                 return -1;
> --
> 2.25.1
>
  

Patch

diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 71a29f3506..6ab4524332 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -1725,7 +1725,7 @@  eventdev_build_telemetry_data(int dev_id,
 	if (xstat_names == NULL)
 		return -1;
 
-	ids = malloc((sizeof(unsigned int)) * num_xstats);
+	ids = malloc((sizeof(uint64_t)) * num_xstats);
 	if (ids == NULL) {
 		free(xstat_names);
 		return -1;