[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240821070221.7157-1-11162571@vivo.com>
Date: Wed, 21 Aug 2024 03:02:20 -0400
From: Yang Ruibin <11162571@...o.com>
To: Sathya Prakash <sathya.prakash@...adcom.com>,
Sreekanth Reddy <sreekanth.reddy@...adcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@...adcom.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
MPT-FusionLinux.pdl@...adcom.com,
linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com,
Yang Ruibin <11162571@...o.com>
Subject: [PATCH v1] drivers:mpt3saa:Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
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@...o.com>
---
drivers/scsi/mpt3sas/mpt3sas_debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c
index a6ab1db81167..306616bdea83 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c
@@ -99,7 +99,7 @@ static const struct file_operations mpt3sas_debugfs_iocdump_fops = {
void mpt3sas_init_debugfs(void)
{
mpt3sas_debugfs_root = debugfs_create_dir("mpt3sas", NULL);
- if (!mpt3sas_debugfs_root)
+ if (IS_ERR(mpt3sas_debugfs_root))
pr_info("mpt3sas: Cannot create debugfs root\n");
}
--
2.34.1
Powered by blists - more mailing lists