linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: "Greenman, Gregory" <gregory.greenman@intel.com>
Cc: "duminjie@vivo.com" <duminjie@vivo.com>,
	"sfr@canb.auug.org.au" <sfr@canb.auug.org.au>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"opensource.kernel@vivo.com" <opensource.kernel@vivo.com>
Subject: Re: [PATCH v1] drivers/net: intel: iwlwifi: fix two parameters check in iwl_mei_dbgfs_register()
Date: Mon, 21 Aug 2023 15:46:49 +0300	[thread overview]
Message-ID: <877cpok1fq.fsf@kernel.org> (raw)
In-Reply-To: <7860d8cbac1eb699de033210c8256afaa8f7b35b.camel@intel.com> (Gregory Greenman's message of "Sun, 13 Aug 2023 15:27:38 +0000")

"Greenman, Gregory" <gregory.greenman@intel.com> writes:

> Hi,
>
> On Wed, 2023-07-12 at 21:14 +0800, Minjie Du wrote:
>> Make IS_ERR() judge the debugfs_create_dir() function return
>> in iwl_mei_dbgfs_register().
>> 
>> Signed-off-by: Minjie Du <duminjie@vivo.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 54445f39f..e5d203a62 100644
>> --- a/drivers/net/wireless/intel/iwlwifi/mei/main.c
>> +++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c
>> @@ -1888,7 +1888,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,
>
> The title should be:
>
> wifi: iwlwifi: mei: ...
>
> Also, why two parameters? It only fixes dbgfs_dir?

It would be better to just remove the check, from debugfs_create_dir():

 * NOTE: it's expected that most callers should _ignore_ the errors returned
 * by this function. Other debugfs functions handle the fact that the "dentry"
 * passed to them could be an error and they don't crash in that case.
 * Drivers should generally work fine even if debugfs fails to init anyway.


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

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

      reply	other threads:[~2023-08-21 12:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 13:14 [PATCH v1] drivers/net: intel: iwlwifi: fix two parameters check in iwl_mei_dbgfs_register() Minjie Du
2023-07-12 14:01 ` Nicolas Escande
2023-08-13 15:27 ` Greenman, Gregory
2023-08-21 12:46   ` Kalle Valo [this message]

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=877cpok1fq.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=duminjie@vivo.com \
    --cc=gregory.greenman@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).