From 3f40b5d767745c35bc798c7406bdcdca15d15b23 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 15 Jul 2016 16:46:45 +0300 Subject: [PATCH] db/fixup_kernel.sh: work around for gfs2_ea_find() It would be better if this wasn't needed, of course. What happens is this: We pass in "el". ef.ef_el = el; memset(el, 0, sizeof(struct gfs2_ea_location)); error = ea_foreach(ip, ea_find_i, &ef); Smatch sees that we memset "el". But ea_foreach() treats "ef" as a void pointer to data. Smatch marks it as an untracked parameter. But smatch doesn't make the jump from ef.ef_el back to el. So the caller says that everything in el is set to zero. Signed-off-by: Dan Carpenter --- smatch_data/db/fixup_kernel.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smatch_data/db/fixup_kernel.sh b/smatch_data/db/fixup_kernel.sh index 0b7038f9..26c304bf 100755 --- a/smatch_data/db/fixup_kernel.sh +++ b/smatch_data/db/fixup_kernel.sh @@ -135,6 +135,9 @@ insert into caller_info values ('fake', 'sysfs_kf_seq_show', '(struct sysfs_ops) /* config fs confuses smatch a little */ update caller_info set value = 4096 where caller='fill_read_buffer' and function='(struct configfs_item_operations)->show_attribute' and type = 1002 and parameter = 2; +/* smatch sees the memset() but not the subsequent changes */ +update return_states set value = "" where function = 'gfs2_ea_find' and return = '0' and type = 101 and parameter = 3; + EOF # fixme: this is totally broken -- 2.11.4.GIT