deref_check: silence some false positives
commit7f5f94e2e5f7501bc4dac8de95cc2b5802b38092
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 27 Jul 2015 21:39:28 +0000 (28 00:39 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 27 Jul 2015 21:39:28 +0000 (28 00:39 +0300)
tree8b2eefda80e18df7a328bb0c835e209453b1acd2
parent3d8190b76a316fd89d68f7c3bf566632ee223f41
deref_check: silence some false positives

The issue here was we had code like:

int some_function(int *p, ...)
{
if (p)
*p = 42;

The problem is that all the callers pass a NULL "p" pointer so instead of
saying that "p" is some non-NULL pointer, smatch instead says that it
doesn't know what "p" is, it could be anything.

So then when we check the "if (implied_not_equal(expr, 0))" setting then
it doesn't return true.  Leading to false positives later.

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