From a0d81220e37655bdb39c5911fa89ec5b06822bb1 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Thu, 13 Jun 2024 18:36:55 -0400 Subject: [PATCH] Coverity model should know that KM_NOSLEEP means no sleeping This fixes an old oversight. I doubt it affected the accuracy of coverity very much, but it is an improvement that I caught while discussing the latest coverity results with Rob N. Signed-off-by: Richard Yao --- contrib/coverity/model.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/coverity/model.c b/contrib/coverity/model.c index 8b4d14ee22a2..4b266206c0ad 100644 --- a/contrib/coverity/model.c +++ b/contrib/coverity/model.c @@ -172,7 +172,7 @@ spl_kmem_alloc(size_t sz, int fl, const char *func, int line) __coverity_negative_sink__(sz); - if (condition1) + if (((fl & KM_NOSLEEP) != KM_NOSLEEP) && condition1) __coverity_sleep__(); if (((fl & KM_NOSLEEP) != KM_NOSLEEP) || condition0) { @@ -193,7 +193,7 @@ spl_kmem_zalloc(size_t sz, int fl, const char *func, int line) __coverity_negative_sink__(sz); - if (condition1) + if (((fl & KM_NOSLEEP) != KM_NOSLEEP) && condition1) __coverity_sleep__(); if (((fl & KM_NOSLEEP) != KM_NOSLEEP) || condition0) { @@ -275,7 +275,7 @@ spl_vmem_alloc(size_t sz, int fl, const char *func, int line) __coverity_negative_sink__(sz); - if (condition1) + if (((fl & KM_NOSLEEP) != KM_NOSLEEP) && condition1) __coverity_sleep__(); if (((fl & KM_NOSLEEP) != KM_NOSLEEP) || condition0) { @@ -294,7 +294,7 @@ spl_vmem_zalloc(size_t sz, int fl, const char *func, int line) (void) func; (void) line; - if (condition1) + if (((fl & KM_NOSLEEP) != KM_NOSLEEP) && condition1) __coverity_sleep__(); if (((fl & KM_NOSLEEP) != KM_NOSLEEP) || condition0) {