Message ID | 20230927041901.07b756e9@rorschach.local.home (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | libtraceeval: Fix allocation of val_stats | expand |
On Wed, Sep 27, 2023 at 04:19:01AM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" <rostedt@goodmis.org> > > 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@goodmis.org> Reviewed-by: Ross Zwisler <zwisler@google.com>
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;