public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] debugfs.c: Fix error checking for debugfs_create_dir
@ 2023-05-24 16:03 Osama Muhammad
  2023-05-24 15:55 ` [PATCH] nfcsim.c: " Osama Muhammad
  2023-05-30 10:29 ` [PATCH] debugfs.c: " Kalle Valo
  0 siblings, 2 replies; 6+ messages in thread
From: Osama Muhammad @ 2023-05-24 16:03 UTC (permalink / raw)
  To: nbd, ryder.lee, lorenzo, shayne.chen, davem
  Cc: linux-wireless, linux-mediatek, linux-kernel, Osama Muhammad

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-30 11:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-24 16:03 [PATCH] debugfs.c: Fix error checking for debugfs_create_dir Osama Muhammad
2023-05-24 15:55 ` [PATCH] nfcsim.c: " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox