From ededfdb4d19be8f934b52164073f90f0de17c3b3 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 12 May 2022 10:09:42 +0300 Subject: [PATCH] tools: Catch more argv_find() when not checked properly Signed-off-by: Donatas Abraitis --- tools/coccinelle/argv_find.cocci | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/coccinelle/argv_find.cocci b/tools/coccinelle/argv_find.cocci index f13b035d7a..1ab19b749b 100644 --- a/tools/coccinelle/argv_find.cocci +++ b/tools/coccinelle/argv_find.cocci @@ -4,8 +4,10 @@ identifier argv; identifier argc; expression e1; expression e2; +identifier I; @@ +( - argv_find(argv, argc, e1, &idx); if ( - idx @@ -14,3 +16,8 @@ expression e2; { e2; } +| +- argv_find(argv, argc, e1, &idx); +... when != I = idx; + when strict +)