From dba939a246e681e21823009f587a098561904a91 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 19 Oct 2023 09:45:00 +0300 Subject: [PATCH] kernel_user_data: don't insert useless data into the DB The estate_assigned() stuff was supposed to limit the data being printed but it ended up printing stuff that wasn't allowed before. So in this case we have: struct something *p = argument; The p->foo is "assigned" but the param was not actually set. We both tests. So far as I can see this doesn't cause any problems, but it does add confusing data to the DB and it does waste resources. Signed-off-by: Dan Carpenter --- smatch_kernel_user_data.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smatch_kernel_user_data.c b/smatch_kernel_user_data.c index adfce839..6ebf1ed1 100644 --- a/smatch_kernel_user_data.c +++ b/smatch_kernel_user_data.c @@ -1014,6 +1014,8 @@ static void return_info_callback(int return_id, char *return_ranges, if (param >= 0) { if (strcmp(printed_name, "$") == 0) return; + if (!param_was_set_var_sym(sm->name, sm->sym)) + return; if (!estate_assigned(sm->state) && !estate_new(sm->state)) return; -- 2.11.4.GIT