double_checking: silence false positives caused by threading
commitfcf3227ed50b114efca19c535b740426007c1eca
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 20 Aug 2015 17:07:16 +0000 (20 20:07 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 20 Aug 2015 17:07:16 +0000 (20 20:07 +0300)
tree52e8f643c462ed21d1d5074fab03bdd519d43903
parent99c68f94ad11103bf68d74cecfa0638a7b7b3a3e
double_checking: silence false positives caused by threading

A common thing in the kernel is when people do:

if (!foo->bar)
return;
spin_lock();
/* test again with the lock held */
if (!foo->bar) {
spin_unlock();
return;
}

This causes false positives in this check.  We can silence them by looking
for a synchronize function call in the lines just prior to the second
check.

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