public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Osama Muhammad <osmtendev@gmail.com>
To: nbd@nbd.name, ryder.lee@mediatek.com, lorenzo@kernel.org,
	shayne.chen@mediatek.com, davem@davemloft.net
Cc: linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	Osama Muhammad <osmtendev@gmail.com>
Subject: [PATCH] debugfs.c: Fix error checking for debugfs_create_dir
Date: Wed, 24 May 2023 21:03:52 +0500	[thread overview]
Message-ID: <20230524160352.19704-1-osmtendev@gmail.com> (raw)

This patch fixes the error checking in debugfs.c in
debugfs_create_dir. The correct way to check if an error occurred
is using 'IS_ERR' inline function.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
---
 drivers/net/wireless/mediatek/mt76/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/debugfs.c b/drivers/net/wireless/mediatek/mt76/debugfs.c
index 57fbcc83e074..d9ba700131fd 100644
--- a/drivers/net/wireless/mediatek/mt76/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/debugfs.c
@@ -109,7 +109,7 @@ mt76_register_debugfs_fops(struct mt76_phy *phy,
 	struct dentry *dir;
 
 	dir = debugfs_create_dir("mt76", phy->hw->wiphy->debugfsdir);
-	if (!dir)
+	if (IS_ERR(dir))
 		return NULL;
 
 	debugfs_create_u8("led_pin", 0600, dir, &phy->leds.pin);
-- 
2.34.1


             reply	other threads:[~2023-05-24 16:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 16:03 Osama Muhammad [this message]
2023-05-24 15:55 ` [PATCH] nfcsim.c: Fix error checking for debugfs_create_dir Osama Muhammad
2023-05-25  8:12   ` Simon Horman
2023-05-30 10:29 ` [PATCH] debugfs.c: " Kalle Valo
2023-05-30 11:02   ` Osama Muhammad
2023-05-30 11:19     ` Osama Muhammad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230524160352.19704-1-osmtendev@gmail.com \
    --to=osmtendev@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox