linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir()
@ 2023-08-31 14:13 Jinjie Ruan
  2023-08-31 14:13 ` [PATCH net 1/3] wifi: iwlwifi: mei: Fix the NULL vs IS_ERR() bug " Jinjie Ruan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jinjie Ruan @ 2023-08-31 14:13 UTC (permalink / raw)
  To: gregory.greenman, kvalo, briannorris, nbd, lorenzo, ryder.lee,
	shayne.chen, sean.wang, matthias.bgg, angelogioacchino.delregno,
	avraham.stern, johannes.berg, emmanuel.grumbach, trix, dmantipov,
	christophe.jaillet, yangyang, linville, rramesh, akarwar,
	nishants, linux-wireless, linux-arm-kernel, linux-mediatek
  Cc: ruanjinjie

Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use
IS_ERR() to check it instead of checking NULL.

Jinjie Ruan (3):
  wifi: iwlwifi: mei: Fix the NULL vs IS_ERR() bug for
    debugfs_create_dir()
  mwifiex: debugfs: Fix the NULL vs IS_ERR() bug for
    debugfs_create_dir()
  wifi: mt76: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()

 drivers/net/wireless/intel/iwlwifi/mei/main.c  | 2 +-
 drivers/net/wireless/marvell/mwifiex/debugfs.c | 2 +-
 drivers/net/wireless/mediatek/mt76/debugfs.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net 1/3] wifi: iwlwifi: mei: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
  2023-08-31 14:13 [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir() Jinjie Ruan
@ 2023-08-31 14:13 ` Jinjie Ruan
  2023-08-31 14:13 ` [PATCH net 2/3] mwifiex: debugfs: " Jinjie Ruan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jinjie Ruan @ 2023-08-31 14:13 UTC (permalink / raw)
  To: gregory.greenman, kvalo, briannorris, nbd, lorenzo, ryder.lee,
	shayne.chen, sean.wang, matthias.bgg, angelogioacchino.delregno,
	avraham.stern, johannes.berg, emmanuel.grumbach, trix, dmantipov,
	christophe.jaillet, yangyang, linville, rramesh, akarwar,
	nishants, linux-wireless, linux-arm-kernel, linux-mediatek
  Cc: ruanjinjie

Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use
IS_ERR() to check it instead of checking NULL.

Fixes: 4ea7da5fad43 ("iwlwifi: mei: add debugfs hooks")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/net/wireless/intel/iwlwifi/mei/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c
index 1dd9106c6513..d0438f9a9ab8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mei/main.c
+++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c
@@ -1894,7 +1894,7 @@ static void iwl_mei_dbgfs_register(struct iwl_mei *mei)
 {
 	mei->dbgfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
 
-	if (!mei->dbgfs_dir)
+	if (IS_ERR(mei->dbgfs_dir))
 		return;
 
 	debugfs_create_ulong("status", S_IRUSR,
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net 2/3] mwifiex: debugfs: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
  2023-08-31 14:13 [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir() Jinjie Ruan
  2023-08-31 14:13 ` [PATCH net 1/3] wifi: iwlwifi: mei: Fix the NULL vs IS_ERR() bug " Jinjie Ruan
@ 2023-08-31 14:13 ` Jinjie Ruan
  2023-08-31 14:13 ` [PATCH net 3/3] wifi: mt76: " Jinjie Ruan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jinjie Ruan @ 2023-08-31 14:13 UTC (permalink / raw)
  To: gregory.greenman, kvalo, briannorris, nbd, lorenzo, ryder.lee,
	shayne.chen, sean.wang, matthias.bgg, angelogioacchino.delregno,
	avraham.stern, johannes.berg, emmanuel.grumbach, trix, dmantipov,
	christophe.jaillet, yangyang, linville, rramesh, akarwar,
	nishants, linux-wireless, linux-arm-kernel, linux-mediatek,
	Yogesh Ashok Powar, Frank Huang, Kiran Divekar
  Cc: ruanjinjie

Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use
IS_ERR() to check it instead of checking NULL.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/net/wireless/marvell/mwifiex/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c
index f9c9fec7c792..a1e074b6d539 100644
--- a/drivers/net/wireless/marvell/mwifiex/debugfs.c
+++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c
@@ -970,7 +970,7 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
 	priv->dfs_dev_dir = debugfs_create_dir(priv->netdev->name,
 					       mwifiex_dfs_dir);
 
-	if (!priv->dfs_dev_dir)
+	if (IS_ERR(priv->dfs_dev_dir))
 		return;
 
 	MWIFIEX_DFS_ADD_FILE(info);
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net 3/3] wifi: mt76: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
  2023-08-31 14:13 [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir() Jinjie Ruan
  2023-08-31 14:13 ` [PATCH net 1/3] wifi: iwlwifi: mei: Fix the NULL vs IS_ERR() bug " Jinjie Ruan
  2023-08-31 14:13 ` [PATCH net 2/3] mwifiex: debugfs: " Jinjie Ruan
@ 2023-08-31 14:13 ` Jinjie Ruan
  2023-08-31 14:17 ` [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs " Russell King (Oracle)
  2023-08-31 15:27 ` Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Jinjie Ruan @ 2023-08-31 14:13 UTC (permalink / raw)
  To: gregory.greenman, kvalo, briannorris, nbd, lorenzo, ryder.lee,
	shayne.chen, sean.wang, matthias.bgg, angelogioacchino.delregno,
	avraham.stern, johannes.berg, emmanuel.grumbach, trix, dmantipov,
	christophe.jaillet, yangyang, linville, rramesh, akarwar,
	nishants, linux-wireless, linux-arm-kernel, linux-mediatek
  Cc: ruanjinjie

Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use
IS_ERR() to check it instead of checking NULL.

Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir()
  2023-08-31 14:13 [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir() Jinjie Ruan
                   ` (2 preceding siblings ...)
  2023-08-31 14:13 ` [PATCH net 3/3] wifi: mt76: " Jinjie Ruan
@ 2023-08-31 14:17 ` Russell King (Oracle)
  2023-08-31 15:27 ` Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Russell King (Oracle) @ 2023-08-31 14:17 UTC (permalink / raw)
  To: Jinjie Ruan
  Cc: gregory.greenman, kvalo, briannorris, nbd, lorenzo, ryder.lee,
	shayne.chen, sean.wang, matthias.bgg, angelogioacchino.delregno,
	avraham.stern, johannes.berg, emmanuel.grumbach, trix, dmantipov,
	christophe.jaillet, yangyang, linville, rramesh, akarwar,
	nishants, linux-wireless, linux-arm-kernel, linux-mediatek

On Thu, Aug 31, 2023 at 10:13:44PM +0800, Jinjie Ruan wrote:
> Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use
> IS_ERR() to check it instead of checking NULL.

It is preferred that the return value from debugfs functions is _not_
checked.

See for example:

https://lore.kernel.org/linux-arm-kernel/20180601111004.1670-3-gregkh@linuxfoundation.org/T/

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir()
  2023-08-31 14:13 [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir() Jinjie Ruan
                   ` (3 preceding siblings ...)
  2023-08-31 14:17 ` [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs " Russell King (Oracle)
@ 2023-08-31 15:27 ` Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2023-08-31 15:27 UTC (permalink / raw)
  To: Jinjie Ruan
  Cc: gregory.greenman, briannorris, nbd, lorenzo, ryder.lee,
	shayne.chen, sean.wang, matthias.bgg, angelogioacchino.delregno,
	avraham.stern, johannes.berg, emmanuel.grumbach, trix, dmantipov,
	christophe.jaillet, yangyang, linville, rramesh, akarwar,
	nishants, linux-wireless, linux-arm-kernel, linux-mediatek

Jinjie Ruan <ruanjinjie@huawei.com> writes:

> Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use
> IS_ERR() to check it instead of checking NULL.
>
> Jinjie Ruan (3):
>   wifi: iwlwifi: mei: Fix the NULL vs IS_ERR() bug for
>     debugfs_create_dir()
>   mwifiex: debugfs: Fix the NULL vs IS_ERR() bug for
>     debugfs_create_dir()
>   wifi: mt76: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
>
>  drivers/net/wireless/intel/iwlwifi/mei/main.c  | 2 +-
>  drivers/net/wireless/marvell/mwifiex/debugfs.c | 2 +-
>  drivers/net/wireless/mediatek/mt76/debugfs.c   | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

Wireless patches go wireless-next tree, not net tree.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-08-31 15:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-31 14:13 [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir() Jinjie Ruan
2023-08-31 14:13 ` [PATCH net 1/3] wifi: iwlwifi: mei: Fix the NULL vs IS_ERR() bug " Jinjie Ruan
2023-08-31 14:13 ` [PATCH net 2/3] mwifiex: debugfs: " Jinjie Ruan
2023-08-31 14:13 ` [PATCH net 3/3] wifi: mt76: " Jinjie Ruan
2023-08-31 14:17 ` [PATCH net 0/3] wifi: Fix the NULL vs IS_ERR() bugs " Russell King (Oracle)
2023-08-31 15:27 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).