index_ptr needs to be freed on the error path. Signed-off-by: Dan Carpenter <error27@xxxxxxxxx> diff --git a/kernel/trace/latency_hist.c b/kernel/trace/latency_hist.c index b3b5ea2..8edc70c 100644 --- a/kernel/trace/latency_hist.c +++ b/kernel/trace/latency_hist.c @@ -204,8 +204,10 @@ static void *l_start(struct seq_file *m, loff_t *pos) , my_hist->beyond_hist_bound_samples , MAX_ENTRY_NUM, "samples"); } - if (index >= MAX_ENTRY_NUM) + if (index >= MAX_ENTRY_NUM) { + kfree(index_ptr); return NULL; + } *index_ptr = index; return index_ptr; -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html