[PATCH] libtraceeval: Fix allocation of val_stats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

The val_stats is to be the same size as the number of val types. But the
number of key times was used to create the size.

Fixes: 8df588c6bc128 ("libtraceeval histogram: Add updating of stats")
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
 src/histograms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/histograms.c b/src/histograms.c
index 42959c154a11..fdc9f0c2fbce 100644
--- a/src/histograms.c
+++ b/src/histograms.c
@@ -740,7 +740,7 @@ static int create_entry(struct traceeval *teval,
 	if (!entry)
 		return -1;
 
-	entry->val_stats = calloc(teval->nr_key_types, sizeof(*entry->val_stats));
+	entry->val_stats = calloc(teval->nr_val_types, sizeof(*entry->val_stats));
 	if (!entry->val_stats)
 		goto fail_entry;
 
-- 
2.40.1





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux