[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201031055931.42844-1-yuehaibing@huawei.com>
Date:   Sat, 31 Oct 2020 13:59:31 +0800
From:   YueHaibing <yuehaibing@...wei.com>
To:     <keescook@...omium.org>, <anton@...msg.org>, <ccross@...roid.com>,
        <tony.luck@...el.com>
CC:     <linux-kernel@...r.kernel.org>, YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH] pstore: Fix passing zero to 'PTR_ERR' warning
Fix smatch warning:
fs/pstore/platform.c:320 allocate_buf_for_compression() warn: passing zero to 'PTR_ERR'
crypto_alloc_comp() never return NULL, use IS_ERR
instead of IS_ERR_OR_NULL to fix this.
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
 fs/pstore/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 36714df37d5d..b7a2a2a31dee 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -315,7 +315,7 @@ static void allocate_buf_for_compression(void)
 	}
 
 	ctx = crypto_alloc_comp(zbackend->name, 0, 0);
-	if (IS_ERR_OR_NULL(ctx)) {
+	if (IS_ERR(ctx)) {
 		kfree(buf);
 		pr_err("crypto_alloc_comp('%s') failed: %ld\n", zbackend->name,
 		       PTR_ERR(ctx));
-- 
2.17.1
Powered by blists - more mailing lists