Commit c930fd89 authored by Xiaoke Wang's avatar Xiaoke Wang Committed by Zheng Zengkai
Browse files

tracing/histogram: Fix a potential memory leak for kstrdup()

stable inclusion
from stable-v5.10.96
commit d71b06aa995007eafd247626d0669b9364c42ad7
bugzilla: https://gitee.com/openeuler/kernel/issues/I55NWB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d71b06aa995007eafd247626d0669b9364c42ad7

--------------------------------

commit e629e7b5 upstream.

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: d380dcde ("tracing: Fix now invalid var_ref_vals assumption in trace action")
Signed-off-by: default avatarXiaoke Wang <xkernel.wang@foxmail.com>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 0bff1d9f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment