From patchwork Wed Aug 21 07:29:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yang Ruibin <11162571@vivo.com> X-Patchwork-Id: 13770954 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2056.outbound.protection.outlook.com [40.107.255.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9C971B81CD; Wed, 21 Aug 2024 07:30:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724225403; cv=fail; b=M0CIDV2W0jTu1MZh5byBst+wlwlI6TeTA6Mj0+MaLAv9jbSoUDpRdC3tJbXfoVtagUBpsjeKnPk8wgiMAnOW9ERDWB+cbILg4KoJL14XQ6X6jC9jgNDkgp0OXCx4n5hP8kp8fjduO3Tq4kLxScPp29pvrnFSlRPbkNWqBAhfBdE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724225403; c=relaxed/simple; bh=gHpHYwqeWybt/A1t0LuhJrVO6nJNzSTHfuWxlu04vH8=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=OVQE5LzGyOLdORsN6yWPAqS9aKHPcg+5Laqh2s94WgaBexlNCe9mER6Kll6/FpUSvNBXHcs9pjTPKIngWNJsXYH+3wkB2UQ7FxkRPkdpqJtcGEvUZ72NYHvBQV6B7jxP/q0GjJp/9pBUjupV+UrGPI/Dv8VwQjXb+EtigNpAoTY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=h7mEZptr; arc=fail smtp.client-ip=40.107.255.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="h7mEZptr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GggVlmpdZw/tgJx7wQdl87Ra5Hfo0BbQ29wfzsH0za6vGfZHS49HKXX0lHF1EX394ZnJgnjzrD8YUcdvA1K7Xt82OyoH4vdwalgl1mWJO/dfVSh4EnoNLw8oaWMx9os0Bmhm60cHN/bC5ThGZ7iFUfO+1UVVJW/zSgmiZ4kKTAY0qRl9e2nMWdB84L6fyUSKVlp/uBrXm3m20Eqc3lpsGkhLUztrW6pmaqmu0jSApA5vDy8tt6rsE4lxPMfLN6E2DlOcii8nIWrqCx3Qdt53AWkpYakLYCx2VAHJJXSpC5F08Cs8tIXYD9yO7OyZETZok4KF+GpPE9Nekyv50HrViA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=9s8KW6Aag/q069wUAVMR7viCXIlfxkad7MgKaLsO4Jk=; b=MQ6pWN7zZpcd0KOxWqRPp42aDsGUhpKlqqGslTUWY/ohVerA6q1bFFmLVqkL6ikAq0ssempwgLk+u8pLTWPldP7eths28h9Y45ImTGGKwJFGQbqsZdDxSEEhy2SErX305betCAGq0v2I2+GV0dGQjWiJ/ZAo2UrrZ5wLMu3JplN4i98WLjMqjr138Nh6IqW7kkr35Dd4J5sbbQqoZNIcNtWPpfIPzGHVfg+DIdvg72tiv34UBVlZw5aOGQTri6EgMGM6vuU/ANZF+Ce9bXhnntVP/6Huz9XI3kADLsxaXoo16KbXK2iGUPOa9a1q+SsrWNcwW/EAzZNvzHqOghMwLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9s8KW6Aag/q069wUAVMR7viCXIlfxkad7MgKaLsO4Jk=; b=h7mEZptr3dXvy1lac0QovT9G7ueErhvzRMR1Izm5JL8+szPNs9nzU6vf/qYHj39tpBX6IkEc3SnN7veeK5jwJxketlET5fjCQWzPT+gA2VLGp3wgXpXQTOn0d+1Vq46l8aOh/8Uytw8kkXMGAQWoHX+MS/cwjr3L+R18WHMh7/o6N406bveGyHugu1DdSfT2HURg31NzyquVOe8NmzjyyODsLVQDpEYS34rJRP4H49liTzoXC9p5iKkzYdEmAfprrpVB4VgZkGJgk06u7pIFwbMNiG/HP7Wb6GcHC7DXTPwCnprGpoTTI8uD4VCoHOm71DIC3uDjCT3fXMxilk7J/w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB6263.apcprd06.prod.outlook.com (2603:1096:400:33d::14) by SEYPR06MB6524.apcprd06.prod.outlook.com (2603:1096:101:171::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.25; Wed, 21 Aug 2024 07:29:58 +0000 Received: from TYZPR06MB6263.apcprd06.prod.outlook.com ([fe80::bd8:d8ed:8dd5:3268]) by TYZPR06MB6263.apcprd06.prod.outlook.com ([fe80::bd8:d8ed:8dd5:3268%6]) with mapi id 15.20.7875.019; Wed, 21 Aug 2024 07:29:58 +0000 From: Yang Ruibin <11162571@vivo.com> To: Martin Tuma , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Yang Ruibin <11162571@vivo.com> Subject: [PATCH v1] drivers:mgb4:Fix the NULL vs IS_ERR() bug for debugfs_create_dir() Date: Wed, 21 Aug 2024 03:29:44 -0400 Message-Id: <20240821072944.9275-1-11162571@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR01CA0165.apcprd01.prod.exchangelabs.com (2603:1096:4:28::21) To TYZPR06MB6263.apcprd06.prod.outlook.com (2603:1096:400:33d::14) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB6263:EE_|SEYPR06MB6524:EE_ X-MS-Office365-Filtering-Correlation-Id: 19540023-e487-46dd-2533-08dcc1b30f52 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|1800799024|38350700014|81742002; X-Microsoft-Antispam-Message-Info: uv5a0Pvk/ByAMFZhzucPuUYI+ceSPWQta9umox5gxnlarmr/8Ud18zVe45I5bIRtkJInfOX9I8pZDuDiUNur+JmYWtP0wiLVR5HgmojpCyTB1XX3qnSBUrfYNtjTTzpdOBgRdXayKJkweJYcLuiU2lJhL3v+0qdRCrwI5QW5M9TcN6Q9r9OqBWAFU8Eza2jc/AGhvOnsAECa7BRbp/LE4m2Q4xGcs3m1TnGBUPzEg86BBBTM6fHN3hMExQxZkzL+g7x0IchjNmVBqllcNu1DtlLxToPt9Zj6HKAk9s4DVxf3WdcQ6V14Ya2lKseahG2VcVTbJsVOdwkrMpdDc6soyoqcqlC7p8gn+8JgVS5T3ZdnNi5jjuAQL4fuzaKtohXlNYm7e1plucCHWANGc0HcT2fz1LQ1m5+7bcuDjtvhm6IIquDhfA0gOyWIXYTBgGFcO4f8vqkBr2VwoYUhpJ0GQJvnLQcHNed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CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(1800799024)(38350700014)(81742002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IldD419+3G1kTlxy+YonDxCrYALgYqq7Cao0TAZOLnTATAOSiYjMWZevaTabSAm6MZSoPR43dE1ph7OcJDeyVL+3AIiBWulchxvczk75U4mPcsPVWN6VwnLzz9JsWCvjUhzlLqBSiw8jHW1ZMxWM5jHrTrl9Fk9KRxBmqftJ61lLC2JUPYWq3jpB0gCM3R1DNpvpsFpAOFy3OiKTmuDGfhjRnnvkxDSOHjjt0tk5ooasU1GdqFKnPqIeB+elxi+SVdFZAxVFooAbA66FTeVprP4lyFPEl+ZAI170CGKb/dGxw78HuG04d4uzCIN3EI31AgX7eaL1X4wLw1cDSR9ewOmluh5dMR+GOXIzqv1YZXaitDL41+hUkISSAH53fFT9dAxDvMXGVapbJaAtWc65F8bGQiwMCIAAHP8mN61f4vFguUI0zoGF2mdukxJIfLFf8VrGG3Jafp5r69S3S1LjlBCuHiunTCuJ8taJOIKteuzMIwq3dNMW1A57tfsl+L4sMLOlgz32ZPrRAdJs5xL26FPJrj8WlEqfVBW2C2+DjrsML52fI05CCClDayB5QZ0XXlesDuYbMLgGbOhyfW+1hoX6ky5PBSODecPTj/1r+du8aVT/ZF2slX0aokuLqQzO2bk7hk2XaQKti5R/1OdLF+RYPZOjCdK0xmvFE9llIQT7/FD6i4xoXFBUlgM1mwJO84vUXgvkUD+JlCUeFKTSGBAKSYsNnSL9OP2zSN1Y7ejiAPeuwTD8XKrT1pOuddYybNBhrSk7jpfpIZql2BtC/BK8PqFlup203q6ViZKZv/BIFVp3g1t50hViu1kovzlZ/ZT4+jlFV7I02kb0o4gzsZ9q/2WA6KKINKJ0axSltMGWlTRYeWkc+dG5qbHTX3LDqxSCc00iokCaFqhZsrN5qAZGDhkRLJwXS3EqAZW1TeFtQh5m4ejo0L0eYaV0+X9AIJFZjsngU5K5Qra9simpMaZqkE8sZC9AuA/9q4Pd0qJbpCw7U5YixYWJLUVF2HDzVH4TbvBJX8pOMXK1tHeR7K1WAEMAu+o9Ofr/sEy3mMwFvpTQSKe+yco5+5RH7F9BpticSp1aCi0X9NYrRJRAe0SY0ifJ7SjDWaY1Spp04KCi8/eFcO8psVyxfou+KM1ZP4Dlf5bu+M282JKkG79zd5orOHFLbmuOGF7cBcwerv8KVDASzWBi+W2NgdJ52q82cunhunim24u9KTf0jCMtsLssvSAZsXrSaJ/uL9wcNE5aJh1cIUQtIPG2t4UKqXpjM0JfqqyZgEHPHcp4OJN1hplh15eLz5Z5QVUVkSsuoPvi0EIWmQUqHpqIi37VkkkKHQxRY7ynYnAuMxwUQhvjq8lC09siVYGV90E2Ve9HvSPOtvMwEzz2/fferkYMgjLiTLtCMtgyrs6Hfy0weVl0YJvMLF7T3eEThiapN0bNsPzBOhtSP+WGt0icWCfayNf9+/mARwzzHYQ4ucl1rha61D7Ubt1RVqUCD3TcV3F233utQZt961bsqQgRln/m5etC8IRGmvEzJhVCAv/a4Wql1bENE+8Z2NUnfJ4fGJh07FFz7ZL0FfonQIvFcLrHIoJY X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19540023-e487-46dd-2533-08dcc1b30f52 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6263.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 07:29:58.2277 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NqcCTReHHQcfq67uQMbwd7WYOGSu6OCwqfDvq53n+8ou0tuRgM1fltCXBsAZT5ECD0229NSQw/yx4LPsAWwbvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6524 The debugfs_create_dir() function returns error pointers. It never returns NULL. So use IS_ERR() to check it. Signed-off-by: Yang Ruibin <11162571@vivo.com> Reviewed-by: Martin Tůma --- drivers/media/pci/mgb4/mgb4_vin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/mgb4/mgb4_vin.c b/drivers/media/pci/mgb4/mgb4_vin.c index e9332abb3172..808eb51b270c 100644 --- a/drivers/media/pci/mgb4/mgb4_vin.c +++ b/drivers/media/pci/mgb4/mgb4_vin.c @@ -860,7 +860,7 @@ static void debugfs_init(struct mgb4_vin_dev *vindev) vindev->debugfs = debugfs_create_dir(vindev->vdev.name, vindev->mgbdev->debugfs); - if (!vindev->debugfs) + if (IS_ERR(vindev->debugfs)) return; vindev->regs[0].name = "CONFIG";