lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 21 Aug 2023 15:46:49 +0300
From:   Kalle Valo <kvalo@...nel.org>
To:     "Greenman, Gregory" <gregory.greenman@...el.com>
Cc:     "duminjie@...o.com" <duminjie@...o.com>,
        "sfr@...b.auug.org.au" <sfr@...b.auug.org.au>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "opensource.kernel@...o.com" <opensource.kernel@...o.com>
Subject: Re: [PATCH v1] drivers/net: intel: iwlwifi: fix two parameters
 check in iwl_mei_dbgfs_register()

"Greenman, Gregory" <gregory.greenman@...el.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@...o.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ