Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp11722189rwr; Sat, 13 May 2023 08:30:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xWYzIkvP5liI1qcxcBvn0x2N5W4IFEtTyXSe71GUviYaNTmBy3vjLZJ+BKJ8Ve0rhhhFI X-Received: by 2002:a05:6a20:4291:b0:100:efa1:eab0 with SMTP id o17-20020a056a20429100b00100efa1eab0mr25841071pzj.2.1683991842647; Sat, 13 May 2023 08:30:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683991842; cv=pass; d=google.com; s=arc-20160816; b=s7AXKqni3662jA7T/5rc62GoqkNhAKRxfuf4q3luR7QHGYIi8VDx6tXXrI/TItgaDb 4YnYwt2gd3tuiRgyp1KulzIsyyE5fO1shXhDtbfrqQTlysPOyFWr5dz7i0OcIXu1jCkB D62ZgiTZyuGjO60+19Vi4PnNXxOuVPMtHwHDYflz+Bcm4tZpC0qqLtXDD5XmuEVotcId orw/HJQD6JV1h7rZ0EZeBtxJJMHhiMIpvNWe9d7jcnSOmisXI6vc/YcFljie4v3lbmzs 07BY8+KLPtbFjvXR31KbmDPk9wh/HbXyMj46xn0DAZ002ZFpRXbgbF2LB+2n7FM2vbBp V9XA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:mime-version:content-transfer-encoding :message-id:date:subject:cc:from:dkim-signature; bh=AjS1N65ZDmqs57j1FSHtVm24YWtFdEP1MdFyJtzlQ10=; b=KeQDDjYZZdg+ANp38nYL65WaO00c9XOupdQOlSrq1+RhdHjbHGA48k1joBm/GYVZCq kStIATFtaP9EpTSzD4jhl9Xk2ke7YrI5+vUW010pfYC+7vtflCA3hx/HGssttKPuiZrE yYNylvHl+XpgCCet1QxTzVkaSAIA4uLp/nKikcxDimU1zTFvXzOXBJ5Qoln+3yAi4wGn +1YgVJb6dJANOKPjH3bbMp9ij7ATRRV4LYCTZYwVtlgd++fDbrZQUHM71YolbmY66I9A kWOLxRxnsip8wZB/+o0qpo9UBf1Tx3OBGeCoJ0nznFbcVigg0EMyjOkyvpslR5fPvmKO BWiA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=EFe212Mr; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a638c4a000000b0051372ef848fsi6644239pgn.697.2023.05.13.08.30.24; Sat, 13 May 2023 08:30:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=EFe212Mr; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239142AbjEMPM4 (ORCPT + 99 others); Sat, 13 May 2023 11:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbjEMPMy (ORCPT ); Sat, 13 May 2023 11:12:54 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11olkn2010.outbound.protection.outlook.com [40.92.20.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A465C1997 for ; Sat, 13 May 2023 08:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bELjW96sXeKv6uMhQrNrOeb6SkxV9qxX2xtz1XmbS1rbvqth4bsffldyZTocKt2H8cZ0aEQKwT8Ywn0zhbbS1khb5ACH9Z/gkIUPclZsZogntidONUwSlucdhHbUWJltLqAr8jkuKSmsvyaG8V98cGibG5o87DY6kIQtvIxDBmMM0Gk5TVa0M0iDjn9wtfVL9tY1aEDGsjY+cfa16Pyap8Ahd6jEvKvi5yBL0viY0qc0B+QBerWKhpQUHjCG17yHtSYYvE8u7kCeqQX7+63Ig+Bdy3niql/O2AX2hlZyJ5LZ8d+j/tYiZ1+1xzfgLcl2WI2q8vJjG6m1tnvNFjQ0NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AjS1N65ZDmqs57j1FSHtVm24YWtFdEP1MdFyJtzlQ10=; b=ElA/MkriRhbEnimUCBhM3pVxUcfKvfDs79jOgMr6buS3rqFerX0HUYc1zzpQfydN7+AT2/y8stVk01xsyfY6w1UcjHgL4y1/RdXstJrfkYFvUlMf9F7qoHRay0JzwfJiZdhcmK0u4bfQ0bpiLELP9sVQfIagy6kyRlzR3XCohXBaTPrwRhSnkpt2FRHvQSA+8kPthmcReRkp3E95sGt6WSnoUDw7kzArmpaHdrHHUEPrGcw6jJ0OYMWjzoWsgDJ8x35O08NA/ihbfsjnBW/vJqYc1t3+rJ3t75dwMbEUKnILDwarTC1WZ3x91lGowk84qgWXcA+EfSmgR1GQDSyWfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AjS1N65ZDmqs57j1FSHtVm24YWtFdEP1MdFyJtzlQ10=; b=EFe212MrmHQSMnKf8hzFGhu8CXqhaahx6mmq1rEK2tFj83JqJo0r6vlpsATsLL7B7UvTeN4mrLeiaVzwS6moOg2Ea6i9OUXHzJaFZBWUrNDpNPEZ1GccQWFNeom5Li2kBgF3s5RiNPnTXSvULB6jG8wXkJUfsAiFuB1uU6gYk+o/33A/8nHBZs+blqZYpKf3naBFZvplhVUfkyAPd+J4jaRQA+7YiQ0zmvvscGSJWcw0+/Zbyl9+nyKiq+btUKsm5Pf0y+dlt3Z4No3P08gbyOnJ7SvoDN09aX3LAAxWzeK0d6Ty1b2KstM0eaRUESu0P2J6xYMN6Q/vN80TIyWUtg== Received: from CY5PR12MB6455.namprd12.prod.outlook.com (2603:10b6:930:35::10) by CH3PR12MB7593.namprd12.prod.outlook.com (2603:10b6:610:141::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.23; Sat, 13 May 2023 15:12:46 +0000 Received: from CY5PR12MB6455.namprd12.prod.outlook.com ([fe80::eece:c2b8:c7ea:a6]) by CY5PR12MB6455.namprd12.prod.outlook.com ([fe80::eece:c2b8:c7ea:a6%6]) with mapi id 15.20.6340.031; Sat, 13 May 2023 15:12:46 +0000 From: mirimmad@outlook.com Cc: skhan@linuxfoundation.org, Immad Mir , Ivan Orlov , Michael Ellerman , Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc: fix debugfs_create_dir error checking Date: Sat, 13 May 2023 20:41:53 +0530 Message-ID: X-Mailer: git-send-email 2.40.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [f4gXV2RqkrTCkGmMEzT+BSG7noXHnHM67NZHcHYLtYsbwPQfsqtB1GCn6VNfZWHa] X-ClientProxiedBy: PN2PR01CA0236.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:eb::20) To CY5PR12MB6455.namprd12.prod.outlook.com (2603:10b6:930:35::10) X-Microsoft-Original-Message-ID: <20230513151153.266877-1-mirimmad@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6455:EE_|CH3PR12MB7593:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a995d73-8bac-493b-3842-08db53c48191 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 28AacB9tP8OfoZFRRvkJEFVSFGZdvwpBdWsrAGyzb/k3cVuRDmlzxFbysr1kHGO4cajjbCOtp+hEXuB+PPaGUEpgo/pgpoQXAQwoDBO6AzWOam5nqpPlUzSNPC5XFtk1AUVbWKTXzdktYCxDm/tGOlealuAcKZ3wKQaY/nX2/N49ljRlIoK6UUC18cLHE8v7zuPl0bsqSXJxjo2YHFUsxD7casdw1PzZt8CLlQxsAlst+xYoUQKTBSX7ka35mTpRWY4aZqZP8zBbkEkVe0KHuFr1kjTbBtrTPbjYARm/VN7Kpax6RUlAf5o2CUQHcPlBt2K7Lml94Bzo/TRE0AKuGI6sKVwjJspWftoNsORCAN+sCnySyP7rwayiinmea0kneK5hlMz2t65RnGgnubwqsJTAEoanTcGhIzWDtoTVUZwBWclnLKayoYsQbXlm9Nm3cb0AAR+k7AV3pO+ESbtd9b66ME/soTOCdZrc3FscbUo5tc+3UjMHyoeGZSZpJn1Pp2CN6lTeUVDwnim/is2FAa0Ib/YrJZYInUyicllLIsxD9ULskTptG3lii2/SDF2p X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZXIoLlEtwJJdoG1FxJoILjFFqQwALnBKQ15QlcPjbWOrfBq0ELhiXFpNAWB0?= =?us-ascii?Q?ZFR/G+rFOozAxJYkZFp8Ld+/pNvDdTUYO4f1OLIV+0AMZFYV8nqYvXGfaDS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mWu1+juc4D4/owtkUv1IsUSEdPy1KhPXbCR9W?= =?us-ascii?Q?pBX3p7fGSIO3SSp/SXEHOmyobog27mPNAZ7FY11mYmWHzTmrJQBB0j7SdsHu?= =?us-ascii?Q?HRo3bKH6RgzOF9YAnrbl2esWV4RIIQDEJDIWkCRe3W/ldvrAKMjv4t6+ZV6t?= =?us-ascii?Q?MGB2ja95IdpiBR1OCmi/sunsPIrQKAxhpmre5Px238j8A3hTV93DsXL6BqZe?= =?us-ascii?Q?0pg4kI44pfT8Dv7H10+96cRhcd7cDLFSqS8IhZ204B1f23aKljBLJXoVmOz+?= =?us-ascii?Q?raQUgBDBehHCBlhFiPpNTaZNgJaY2UAkmrsTPZ6gOA=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a995d73-8bac-493b-3842-08db53c48191 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6455.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2023 15:12:46.0372 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7593 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Immad Mir The debugfs_create_dir returns ERR_PTR incase of an error and the correct way of checking it by using the IS_ERR inline function, and not the simple null comparision. This patch fixes this. Suggested-By: Ivan Orlov Signed-off-by: Immad Mir --- arch/powerpc/platforms/powernv/opal-xscom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c index 6b4eed2ef..262cd6fac 100644 --- a/arch/powerpc/platforms/powernv/opal-xscom.c +++ b/arch/powerpc/platforms/powernv/opal-xscom.c @@ -168,7 +168,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn, ent->path.size = strlen((char *)ent->path.data); dir = debugfs_create_dir(ent->name, root); - if (!dir) { + if (IS_ERR(dir)) { kfree(ent->path.data); kfree(ent); return -1; @@ -190,7 +190,7 @@ static int scom_debug_init(void) return 0; root = debugfs_create_dir("scom", arch_debugfs_dir); - if (!root) + if (IS_ERR(root)) return -1; rc = 0; -- 2.40.0