Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3652007rdb; Wed, 13 Sep 2023 20:34:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkLnhHbI3XIp7efpshsVdDKWoT3/LwEhYktfIvJJepici/3j7tgT19p+ByXRUHwxQZHxOT X-Received: by 2002:a05:6870:e88a:b0:1c0:fc08:8f91 with SMTP id q10-20020a056870e88a00b001c0fc088f91mr5112050oan.40.1694662465505; Wed, 13 Sep 2023 20:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694662465; cv=none; d=google.com; s=arc-20160816; b=tZ/J0k8UNNXsB+FzFvwQX8Hcihb4KUXofsXGziBIDmEcvzGcIPbHO4zkxtj1/0XPTP rxcHLJuvr/Tae5mdIg32tMCPsP3p+ILE/R5pG8WaVSw5gPvMyf+KlxISJAmpMK/KMkJO Ua5qpYvMniAaQGeki1qyQGHPPas9aazumOsdXeIuUq1z0xDQpgQ1M+xEg4vz9GiLyPza jSkP1JdPnVvwkIKyxOYof+yy0KUU5fYPqeccAjP3KfQ1VTkzG/I0vTQ41S+mgVh2/dw/ 9gDQKJoKdKdo3bYMXJfM/h0n4xmgPZiCGsCxpThiAVDdG8PaKW5ftLB/mCB4Ab5zWozu VuEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=iVyaVD2nuSoTHcn2C+HpaPyf3jOMrCo0eqwEZV61bdU=; fh=ns0fhqgIZz1+YM3zjiT0Rk1odgU7L1Gkj437Es4PpBI=; b=lSt8PBdiKLTKAtYj8tXUIwrOytrezfOlITpHZTlHrV0rElbIl2OAr4BTVPLKa2GCQI RQ654YDBgGD6xikPA91L/4dUt4T2x8bk1vaDtPncTB3Fwubbt5arqyHFE4EOYhnIVQxE Tyf/jKZrFftphwOClAMbXpdKQQnfvrrSjeM4SGds55nmCOLpHPNzErzMC68ODLBE4D/k j521Hgq1IEFPs+itd5y8zrCb6KArlrdAGbk4xudM3vw0SNaSz8Qb8A9KQfH2OhuZbp5g bBRgvKXIO3y1HANXM2wqxtwtZKlx/IAILvidBp5ku7r0kxGozsaeKg2uyEIZjaOuXitn uTUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id o66-20020a634145000000b00577796b5206si570413pga.898.2023.09.13.20.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 20:34:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 595188065337; Wed, 13 Sep 2023 20:32:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233938AbjINDaR (ORCPT + 57 others); Wed, 13 Sep 2023 23:30:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbjINDaQ (ORCPT ); Wed, 13 Sep 2023 23:30:16 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C3271BDA for ; Wed, 13 Sep 2023 20:30:12 -0700 (PDT) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RmN6d2vYFzVkX2; Thu, 14 Sep 2023 11:27:21 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 14 Sep 2023 11:30:09 +0800 From: Jinjie Ruan To: , Ping-Ke Shih , Kalle Valo , Stanislaw Gruszka , Brian Norris , Yan-Hsuan Chuang CC: Subject: [PATCH] rtw88: debug: Fix Fix the NULL vs IS_ERR() bug for debugfs_create_file() Date: Thu, 14 Sep 2023 11:29:15 +0800 Message-ID: <20230914032915.3758138-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 20:32:03 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Since debugfs_create_file() return ERR_PTR and never return NULL, so use IS_ERR() to check it instead of checking NULL. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Jinjie Ruan --- drivers/net/wireless/realtek/rtw88/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c index f8ba133baff0..35bc37a3c469 100644 --- a/drivers/net/wireless/realtek/rtw88/debug.c +++ b/drivers/net/wireless/realtek/rtw88/debug.c @@ -1233,9 +1233,9 @@ static struct rtw_debugfs_priv rtw_debug_priv_dm_cap = { #define rtw_debugfs_add_core(name, mode, fopname, parent) \ do { \ rtw_debug_priv_ ##name.rtwdev = rtwdev; \ - if (!debugfs_create_file(#name, mode, \ + if (IS_ERR(debugfs_create_file(#name, mode, \ parent, &rtw_debug_priv_ ##name,\ - &file_ops_ ##fopname)) \ + &file_ops_ ##fopname))) \ pr_debug("Unable to initialize debugfs:%s\n", \ #name); \ } while (0) -- 2.34.1