Skip to contentSkip to conversation

eventdev: fix invalid memory free operation

PATCH In review Abdullah Sevincer 2 participants 2 messages Feb 28, 2023 – Mar 3, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eventdev: fix invalid memory free operation

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")
---
 lib/eventdev/rte_eventdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/eventdev/rte_eventdev.c +1 -1
index 71a29f3506..6ab4524332 100644
@@ -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;
Signature · 1 line
2.25.1
Acked-by Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Abdullah Sevincer

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")

Looks good to me.

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")
Quoted 20 lines
---
 lib/eventdev/rte_eventdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/eventdev/rte_eventdev.c +1 -2
index 71a29f3506..6ab4524332 100644
@@ -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