tracing/histograms: Return an error if we fail to add histogram to hist_vars list
authorMohamed Khalfella <mkhalfella@purestorage.com>
Fri, 14 Jul 2023 20:33:41 +0000 (20:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:50:49 +0000 (08:50 +0200)
commit61622fa3791495129b27c71a25f3184a8c332c8c
tree6687950e08df55850f267f75c61421e78eab5fb9
parentbae17da3ae4c21b26a6216d64b5e7d8fbc603ea2
tracing/histograms: Return an error if we fail to add histogram to hist_vars list

commit 4b8b3905165ef98386a3c06f196c85d21292d029 upstream.

Commit 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if
they have referenced variables") added a check to fail histogram creation
if save_hist_vars() failed to add histogram to hist_vars list. But the
commit failed to set ret to failed return code before jumping to
unregister histogram, fix it.

Link: https://lore.kernel.org/linux-trace-kernel/20230714203341.51396-1-mkhalfella@purestorage.com
Cc: stable@vger.kernel.org
Fixes: 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables")
Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_events_hist.c