db: make a file kernel.return_fixes for updating return values
commit618cd5c68310f37068a5c6896c68755140a734e0
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Apr 2016 10:26:37 +0000 (14 13:26 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Apr 2016 10:26:37 +0000 (14 13:26 +0300)
treef69a35dad2e4cd741fbf566f1918795d7966e03d
parente2719e3adc7e55a549714dce1ef76954995858d8
db: make a file kernel.return_fixes for updating return values

One issue that we have a lot is that Smatch can't determine the return
value.  There are several reasons for this, one is that it's sometimes
just complicated to parse the code.  Another is that maybe we have a
function that always returns zero but we want to handle future errors.  In
the kernel, normally functions return negative errors but callers normally
do:
ret = func();
if (ret)
return ret;

So Smatch assumes that errors will be anything non-zero.  And then down
the line, you have one caller which does "if (ret < 0) {" so Smatch gets
confused.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_data/db/create_db.sh
smatch_data/db/kernel.return_fixes [new file with mode: 0644]