impossible: don't mark returns as impossible if threads are involved
commitf53e8d238d8d010806716a18fc1d99c055455036
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 8 May 2023 07:12:56 +0000 (8 10:12 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Mon, 8 May 2023 07:12:56 +0000 (8 10:12 +0300)
treea8f59c6e86a72af11a144b8aa7d9829389f8906e
parent3576f9593a36c54ef2b8736c9759171f6a2b18f7
impossible: don't mark returns as impossible if threads are involved

Smatch doesn't understand threads at all.  So what would happen is that
you set foo->bar = 0; then wait for it to be set in another thread, and
then check the value again.  Smatch marks the non-zero paths as impossible
and CULLs them from the DB.  This means that the success path is marked
as impossible.

Of course, that means you miss some paths and some information.  But what
it also means is that when the callers check "if (ret) {" then Smatch
ignores the implications from that.  (Smatch ignores the implications from
known true/false conditions).  So that leads to confusing false positives.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
smatch_impossible.c