From bba708bc43aef0998c5124f7ef0644f49c07febf Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 7 Jun 2018 17:06:22 +0300 Subject: [PATCH] comparison: fix a NULL dereference Apparently "state" can be NULL here... I had built a kernel with this code but only glanced at the results. :( Signed-off-by: Dan Carpenter --- smatch_comparison.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smatch_comparison.c b/smatch_comparison.c index f8722fd9..8fb65628 100644 --- a/smatch_comparison.c +++ b/smatch_comparison.c @@ -625,6 +625,8 @@ static void match_inc(struct sm_state *sm) FOR_EACH_PTR(links, tmp) { state = get_state(compare_id, tmp, NULL); + if (!state) + continue; data = state->data; if (!data) continue; -- 2.11.4.GIT