db: fix how &foo->lock states are inserted into the caller_info table
commita2cb8fcf658b91e94ea1352dea2b9b16bb69bd27
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 3 Feb 2021 10:52:01 +0000 (3 13:52 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 3 Feb 2021 10:52:01 +0000 (3 13:52 +0300)
tree0b0a9534f70e3ca7350f3e153f8c3212980443a3
parent2e873ae10c63df991f9cdff12e5dc8b21fd59b67
db: fix how &foo->lock states are inserted into the caller_info table

The check_locks.c check has a lot of &foo->lock states and they're supposed
be inserted into the DB correctly when we call "frob(foo);".  But they
were not handled correctly by the caller_info callback (new style).  They
were handled but the CALL_HOOK instead which passes the parameter as -2.

Adding this missing case will fix that problem.  This code is sort of
copy and pasted and I'm not 100% comfortable that it's correct but it's
mostly correct.  Probably there is an easier and better what to manage
this stuff...

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