public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v1] net:wireless:Fix an NULL vs IS_ERR() bug for debugfs_create_dir()
@ 2023-07-13  3:03 Wang Ming
  2023-07-13 15:58 ` Jeff Johnson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wang Ming @ 2023-07-13  3:03 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, Kalle Valo, Rajkumar Manoharan,
	John W. Linville, Sujith Manoharan, linux-wireless, linux-kernel
  Cc: opensource.kernel, Wang Ming

The debugfs_create_dir() function returns error pointers,
it never returns NULL. Most incorrect error checks were fixed,
but the one in ath9k_htc_init_debug() was forgotten.

Fix the remaining error check.

Signed-off-by: Wang Ming <machel@vivo.com>

Fixes: e5facc75fa91 ("ath9k_htc: Cleanup HTC debugfs")
---
 drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index b3ed65e5c4da..c55aab01fff5 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
@@ -491,7 +491,7 @@ int ath9k_htc_init_debug(struct ath_hw *ah)
 
 	priv->debug.debugfs_phy = debugfs_create_dir(KBUILD_MODNAME,
 					     priv->hw->wiphy->debugfsdir);
-	if (!priv->debug.debugfs_phy)
+	if (IS_ERR(priv->debug.debugfs_phy))
 		return -ENOMEM;
 
 	ath9k_cmn_spectral_init_debug(&priv->spec_priv, priv->debug.debugfs_phy);
-- 
2.25.1


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

* Re: [PATCH net v1] net:wireless:Fix an NULL vs IS_ERR() bug for debugfs_create_dir()
  2023-07-13  3:03 [PATCH net v1] net:wireless:Fix an NULL vs IS_ERR() bug for debugfs_create_dir() Wang Ming
@ 2023-07-13 15:58 ` Jeff Johnson
  2023-08-08 13:29 ` Toke Høiland-Jørgensen
  2023-08-25  7:35 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2023-07-13 15:58 UTC (permalink / raw)
  To: Wang Ming, Toke Høiland-Jørgensen, Kalle Valo,
	Rajkumar Manoharan, John W. Linville, Sujith Manoharan,
	linux-wireless, linux-kernel
  Cc: opensource.kernel

correct subject prefix is "wifi: ath9k: "

On 7/12/2023 8:03 PM, Wang Ming wrote:
> The debugfs_create_dir() function returns error pointers,
> it never returns NULL. Most incorrect error checks were fixed,
> but the one in ath9k_htc_init_debug() was forgotten.
> 
> Fix the remaining error check.
> 
> Signed-off-by: Wang Ming <machel@vivo.com>
> 
> Fixes: e5facc75fa91 ("ath9k_htc: Cleanup HTC debugfs")
> ---
>   drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
> index b3ed65e5c4da..c55aab01fff5 100644
> --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
> @@ -491,7 +491,7 @@ int ath9k_htc_init_debug(struct ath_hw *ah)
>   
>   	priv->debug.debugfs_phy = debugfs_create_dir(KBUILD_MODNAME,
>   					     priv->hw->wiphy->debugfsdir);
> -	if (!priv->debug.debugfs_phy)
> +	if (IS_ERR(priv->debug.debugfs_phy))
>   		return -ENOMEM;
>   
>   	ath9k_cmn_spectral_init_debug(&priv->spec_priv, priv->debug.debugfs_phy);


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

* Re: [PATCH net v1] net:wireless:Fix an NULL vs IS_ERR() bug for debugfs_create_dir()
  2023-07-13  3:03 [PATCH net v1] net:wireless:Fix an NULL vs IS_ERR() bug for debugfs_create_dir() Wang Ming
  2023-07-13 15:58 ` Jeff Johnson
@ 2023-08-08 13:29 ` Toke Høiland-Jørgensen
  2023-08-25  7:35 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2023-08-08 13:29 UTC (permalink / raw)
  To: Wang Ming, Kalle Valo, Rajkumar Manoharan, John W. Linville,
	Sujith Manoharan, linux-wireless, linux-kernel
  Cc: opensource.kernel, Wang Ming

Wang Ming <machel@vivo.com> writes:

> The debugfs_create_dir() function returns error pointers,
> it never returns NULL. Most incorrect error checks were fixed,
> but the one in ath9k_htc_init_debug() was forgotten.
>
> Fix the remaining error check.
>
> Signed-off-by: Wang Ming <machel@vivo.com>

Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>

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

* Re: [PATCH net v1] net:wireless:Fix an NULL vs IS_ERR() bug for debugfs_create_dir()
  2023-07-13  3:03 [PATCH net v1] net:wireless:Fix an NULL vs IS_ERR() bug for debugfs_create_dir() Wang Ming
  2023-07-13 15:58 ` Jeff Johnson
  2023-08-08 13:29 ` Toke Høiland-Jørgensen
@ 2023-08-25  7:35 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2023-08-25  7:35 UTC (permalink / raw)
  To: Wang Ming
  Cc: Toke Høiland-Jørgensen, Rajkumar Manoharan,
	John W. Linville, Sujith Manoharan, linux-wireless, linux-kernel,
	opensource.kernel, Wang Ming

Wang Ming <machel@vivo.com> wrote:

> The debugfs_create_dir() function returns error pointers,
> it never returns NULL. Most incorrect error checks were fixed,
> but the one in ath9k_htc_init_debug() was forgotten.
> 
> Fix the remaining error check.
> 
> Fixes: e5facc75fa91 ("ath9k_htc: Cleanup HTC debugfs")
> Signed-off-by: Wang Ming <machel@vivo.com>
> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

1e4134610d93 wifi: ath9k: use IS_ERR() with debugfs_create_dir()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230713030358.12379-1-machel@vivo.com/

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


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

end of thread, other threads:[~2023-08-25  7:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-13  3:03 [PATCH net v1] net:wireless:Fix an NULL vs IS_ERR() bug for debugfs_create_dir() Wang Ming
2023-07-13 15:58 ` Jeff Johnson
2023-08-08 13:29 ` Toke Høiland-Jørgensen
2023-08-25  7:35 ` Kalle Valo

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