From dcda0b30b11bf2d67e96642bfde174164e8c7171 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 5 Aug 2021 14:48:16 +0300 Subject: [PATCH] validation: update sm_switch2.c (remove NULL dereference checks) I removed the NULL dereference check because it had too many false positives and the missing break test has also changed. Also the some_func() needs a declaration. Signed-off-by: Dan Carpenter --- validation/sm_switch2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/validation/sm_switch2.c b/validation/sm_switch2.c index 4eb788f8..01663a19 100644 --- a/validation/sm_switch2.c +++ b/validation/sm_switch2.c @@ -2,6 +2,8 @@ struct foo { int a; }; +int some_func(void); + struct foo *a; struct foo *b; struct foo *c; @@ -44,8 +46,6 @@ void func (void) * check-command: smatch --spammy sm_switch2.c * * check-output-start -sm_switch2.c:31 func() warn: missing break? reassigning 'a->a' -sm_switch2.c:31 func() error: potential NULL dereference 'a'. -sm_switch2.c:32 func() error: potential NULL dereference 'b'. +sm_switch2.c:33 func() warn: missing break? reassigning 'a->a' * check-output-end */ -- 2.11.4.GIT