From ff1cc4d453ffeddf3cf3dc031c5b129eefbf3e2c Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 27 Apr 2024 13:22:37 +0300 Subject: [PATCH] db/fixup_kernel.sh: fix clear_user() handling There are two changes here: 1) Switch from double quotes to single quotes. Atin Bainada reported that this was still an issue. 2) Add a grep -v '\['. Apparently current versions of smatch are able to determine some of these relationship automatically and this code was recording bogus relationships like: "1-u64max[==$1][<=$1]" when it should have just been "1-u64max[==$1]". Reported-by: Atin Bainada Signed-off-by: Dan Carpenter --- smatch_data/db/fixup_kernel.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smatch_data/db/fixup_kernel.sh b/smatch_data/db/fixup_kernel.sh index b6c7e351..46f9a19f 100755 --- a/smatch_data/db/fixup_kernel.sh +++ b/smatch_data/db/fixup_kernel.sh @@ -242,8 +242,8 @@ delete from return_states where function = '__dev_printk' and type = 103; EOF -for i in $(echo "select distinct return from return_states where function = 'clear_user';" | sqlite3 $db_file ) ; do - echo "update return_states set return = \"$i[<=\$1]\" where return = \"$i\" and function = 'clear_user';" | sqlite3 $db_file +for i in $(echo "select distinct return from return_states where function = 'clear_user';" | sqlite3 $db_file | grep -v '\[' ) ; do + echo "update return_states set return = '$i[<=\$1]' where return = '$i' and function = 'clear_user';" | sqlite3 $db_file done echo "select distinct file, function from function_ptr where ptr='(struct rtl_hal_ops)->set_hw_reg';" \ -- 2.11.4.GIT