[PATCH net v1] ath6kl:Fix error checking for debugfs_create_dir()

Wang Ming posted 1 patch 2 years, 7 months ago
drivers/net/wireless/ath/ath6kl/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH net v1] ath6kl:Fix error checking for debugfs_create_dir()
Posted by Wang Ming 2 years, 7 months ago
The debugfs_create_dir() function returns error pointers,
it never returns NULL. Most incorrect error checks were fixed,
but the one in ath6kl_debug_init_fs() was forgotten.

Fix the remaining error check.

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

Fixes: 9b9a4f2acac2 ("ath6kl: store firmware logs in skbuffs")
---
 drivers/net/wireless/ath/ath6kl/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index 433a047f3747..505af195e299 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -1793,7 +1793,7 @@ int ath6kl_debug_init_fs(struct ath6kl *ar)
 {
 	ar->debugfs_phy = debugfs_create_dir("ath6kl",
 					     ar->wiphy->debugfsdir);
-	if (!ar->debugfs_phy)
+	if (IS_ERR(ar->debugfs_phy))
 		return -ENOMEM;
 
 	debugfs_create_file("tgt_stats", 0400, ar->debugfs_phy, ar,
-- 
2.25.1
Re: [PATCH net v1] ath6kl:Fix error checking for debugfs_create_dir()
Posted by Paolo Abeni 2 years, 6 months ago
On Thu, 2023-07-13 at 12:05 +0800, 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 ath6kl_debug_init_fs() was forgotten.
> 
> Fix the remaining error check.
> 
> Signed-off-by: Wang Ming <machel@vivo.com>
> 
> Fixes: 9b9a4f2acac2 ("ath6kl: store firmware logs in skbuffs")

The SoB tag should be after the 'Fixes' one and you must avoid empty
lines in between.

(The same applies to your other patch)

Cheers,

Paolo
Re: [PATCH net v1] ath6kl:Fix error checking for debugfs_create_dir()
Posted by Kalle Valo 2 years, 6 months ago
Paolo Abeni <pabeni@redhat.com> writes:

> On Thu, 2023-07-13 at 12:05 +0800, 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 ath6kl_debug_init_fs() was forgotten.
>> 
>> Fix the remaining error check.
>> 
>> Signed-off-by: Wang Ming <machel@vivo.com>
>> 
>> Fixes: 9b9a4f2acac2 ("ath6kl: store firmware logs in skbuffs")
>
> The SoB tag should be after the 'Fixes' one and you must avoid empty
> lines in between.
>
> (The same applies to your other patch)

And the same as with the ath9k patch: this should go to ath-next, not
net.

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

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