From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E43B4C388F7 for ; Sat, 31 Oct 2020 05:59:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B574B20791 for ; Sat, 31 Oct 2020 05:59:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726319AbgJaF7t (ORCPT ); Sat, 31 Oct 2020 01:59:49 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6676 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgJaF7s (ORCPT ); Sat, 31 Oct 2020 01:59:48 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CNT6C0Y0wz15Ntk; Sat, 31 Oct 2020 13:59:47 +0800 (CST) Received: from localhost (10.174.176.180) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Sat, 31 Oct 2020 13:59:40 +0800 From: YueHaibing To: , , , CC: , YueHaibing Subject: [PATCH] pstore: Fix passing zero to 'PTR_ERR' warning Date: Sat, 31 Oct 2020 13:59:31 +0800 Message-ID: <20201031055931.42844-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.176.180] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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