db: print return_states information in a more detailed way
commit08179da07cb0356d6ccabfc4d70e98dafb7ec0af
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Dec 2012 12:51:10 +0000 (14 15:51 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Dec 2012 12:51:10 +0000 (14 15:51 +0300)
tree557fd13cd147813bcb679d9efe0a953ce7e880f1
parentb215689f648c2ced400e9db5884d8cdc808e7a1d
db: print return_states information in a more detailed way

The return_states works ok already if you a lot of split out returns:

if (x > 100)
return -EINVAL;
p = kmalloc();
if (!p)
return -ENOMEM;

But where it breaks down is if you have a bunch of places which do:

ret = some_func();
if (ret)
goto out;
p = kmalloc();
if (!p) {
ret = -ENOMEM;
goto out;
}

Because at the end there is just one return path for success and failure
and everything is jumbled together.  This patch separates the return
values apart.

Also it handles the condition where we do:

return x >= 0 && x < 100;

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_db.c