From e6737d4ee9de9af86061de58cbb3fcb14fd0ffbc Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Thu, 6 Jun 2024 17:38:29 +0200
Subject: [PATCH 15/15] libtracefs: Initialize val in build_filter()
In build_filter(), val is only initialized if filter->rval->type is
either EXPR_NUMBER or EXPR_STRING. AS far as I can understand that is
expected at that point. Howvever, it doesn't cost much to initialize
it in case the parser let some bogus request pass by and it should
prevent the static analyser to complain.
Link: https://lore.kernel.org/linux-trace-devel/20240606153830.2666120-16-jmarchan@redhat.com
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
src/tracefs-sqlhist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tracefs-sqlhist.c b/src/tracefs-sqlhist.c
index 0f678c1..08bd0fa 100644
--- a/src/tracefs-sqlhist.c
+++ b/src/tracefs-sqlhist.c
@@ -1109,7 +1109,7 @@ static int build_filter(struct tep_handle *tep, struct sqlhist_bison *sb,
const char *val);
struct filter *filter = &expr->filter;
enum tracefs_compare cmp;
- const char *val;
+ const char *val = NULL;
int and_or = TRACEFS_FILTER_AND;
char num[64];
int ret;
--
2.45.2