[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230712120702.14054-1-duminjie@vivo.com>
Date: Wed, 12 Jul 2023 20:07:02 +0800
From: Minjie Du <duminjie@...o.com>
To: Kashyap Desai <kashyap.desai@...adcom.com>,
Sumit Saxena <sumit.saxena@...adcom.com>,
Shivasharan S <shivasharan.srikanteshwara@...adcom.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
megaraidlinux.pdl@...adcom.com (open list:MEGARAID SCSI/SAS DRIVERS),
linux-scsi@...r.kernel.org (open list:MEGARAID SCSI/SAS DRIVERS),
linux-kernel@...r.kernel.org (open list)
Cc: opensource.kernel@...o.com, Minjie Du <duminjie@...o.com>
Subject: [PATCH v1] drivers: scsi : fix parameter check in two func
Make IS_ERR() judge the debugfs_create_dir() function return
in megasas_init_debugfs() and megasas_setup_debugfs.
Signed-off-by: Minjie Du <duminjie@...o.com>
---
drivers/scsi/megaraid/megaraid_sas_debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_debugfs.c b/drivers/scsi/megaraid/megaraid_sas_debugfs.c
index c69760775..b8b66d590 100644
--- a/drivers/scsi/megaraid/megaraid_sas_debugfs.c
+++ b/drivers/scsi/megaraid/megaraid_sas_debugfs.c
@@ -102,7 +102,7 @@ static const struct file_operations megasas_debugfs_raidmap_fops = {
void megasas_init_debugfs(void)
{
megasas_debugfs_root = debugfs_create_dir("megaraid_sas", NULL);
- if (!megasas_debugfs_root)
+ if (IS_ERR(megasas_debugfs_root))
pr_info("Cannot create debugfs root\n");
}
@@ -132,7 +132,7 @@ megasas_setup_debugfs(struct megasas_instance *instance)
if (!instance->debugfs_root) {
instance->debugfs_root =
debugfs_create_dir(name, megasas_debugfs_root);
- if (!instance->debugfs_root) {
+ if (IS_ERR(instance->debugfs_root)) {
dev_err(&instance->pdev->dev,
"Cannot create per adapter debugfs directory\n");
return;
--
2.39.0
Powered by blists - more mailing lists