You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
tracing/histogram: Fix a potential memory leak for kstrdup()
commite629e7b525upstream. kfree() is missing on an error path to free the memory allocated by kstrdup(): p = param = kstrdup(data->params[i], GFP_KERNEL); So it is better to free it via kfree(p). Link: https://lkml.kernel.org/r/tencent_C52895FD37802832A3E5B272D05008866F0A@qq.com Cc: stable@vger.kernel.org Fixes:d380dcde9a("tracing: Fix now invalid var_ref_vals assumption in trace action") Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
561a22d44a
commit
d71b06aa99
@@ -3506,6 +3506,7 @@ static int trace_action_create(struct hist_trigger_data *hist_data,
|
||||
|
||||
var_ref_idx = find_var_ref_idx(hist_data, var_ref);
|
||||
if (WARN_ON(var_ref_idx < 0)) {
|
||||
kfree(p);
|
||||
ret = var_ref_idx;
|
||||
goto err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user