From 80a3bbef3d77503e77efe801a453eb2dab54b20a Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 20 Jan 2021 07:15:10 +0100 Subject: [PATCH] qa/cocci: support FAIL macros in malloc check --- qa/coccinelle/malloc-error-check.cocci | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qa/coccinelle/malloc-error-check.cocci b/qa/coccinelle/malloc-error-check.cocci index b245189a23..96c09f0b85 100644 --- a/qa/coccinelle/malloc-error-check.cocci +++ b/qa/coccinelle/malloc-error-check.cocci @@ -52,6 +52,12 @@ if (x != NULL) S1 else S2 if (x && E1) S1 | BUG_ON(x == NULL) +| +FAIL_IF(x == NULL) +| +FAIL_IF(unlikely(x == NULL)) +| +FAIL_IF_NULL(x) ) -- 2.47.2