implied: db: fix how returns are broken apart
commit1c5f3ea4008392ab9e1346078c2de3e20eed6ee4
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 8 Apr 2013 06:41:51 +0000 (8 09:41 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 8 Apr 2013 06:41:51 +0000 (8 09:41 +0300)
treed36eecaa9c54bf844c486a06beba4536cd30c374
parentacba13bc3b22e631a7faa1f9296870a700bb391d
implied: db: fix how returns are broken apart

This function is used in db to process code like this:

err = some_func();
if (err)
goto err_out;
...
err = some_other_func();
if (err)
goto err_out;

return 0;
err_out:
cleanup();
return err;

At the end, "err" could be a bunch of different error code.  If we treat it
like one thing then we could lose information compared to the code returned
directly after each failure.

So what we do is we look at all the sources of "err" where "err" came from.
We take the implications of each error return.

This function is looking at the implications to see which of the old states
have been changed.  It checks the wrong variable so it says none of the
states have been modified.  So each return is like a direct return without
any additional clean up work being done.

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