db/kernel.return_fixes: fix scope_guard() parsing
commit42b3683afb0fc66e19618af446e56906b642a4f9
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 29 Nov 2023 12:29:38 +0000 (29 15:29 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Wed, 29 Nov 2023 12:29:38 +0000 (29 15:29 +0300)
tree6f85e38cd37e4e2be312ecdc34a1e3e9be7dc48f
parentffb10fbdd253f95aec4eca89701023796ea4458f
db/kernel.return_fixes: fix scope_guard() parsing

The scope_guard() macro looks something like this:

scoped_guard (rcu) {
...
}

The problem is that we recently added support for try_locks where if we
fail to take the lock then we don't enter the block.  However for ordinary
lock functions we do enter the block.  The way we differentiate is by
testing the lock_ptr.

Unfortunately, Smatch doesn't know that the lock_ptr is always non-NULL for
ordinary locks.  This leads to uninitialized variable warnings.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
smatch_data/db/kernel.return_fixes