LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] lib:Fix more error checking for debugfs_create_dir()
@ 2023-07-11 11:16 Wang Ming
  2023-07-11 19:33 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Ming @ 2023-07-11 11:16 UTC (permalink / raw
  To: Wang Ming, linux-kernel; +Cc: opensource.kernel

In case of failure, debugfs_create_dir() does not return NULL,
but an error pointer.  Most incorrect error checks were fixed,
but the one in test_fpu_init() was forgotten.

Fix the remaining error check.

Signed-off-by: Wang Ming <machel@vivo.com>
---
 lib/test_fpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/test_fpu.c b/lib/test_fpu.c
index e82db19fed84..5d6aa4691b4a 100644
--- a/lib/test_fpu.c
+++ b/lib/test_fpu.c
@@ -69,7 +69,7 @@ static struct dentry *selftest_dir;
 static int __init test_fpu_init(void)
 {
 	selftest_dir = debugfs_create_dir("selftest_helpers", NULL);
-	if (!selftest_dir)
+	if (IS_ERR(selftest_dir))
 		return -ENOMEM;
 
 	debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,
-- 
2.25.1


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

* Re: [PATCH v2] lib:Fix more error checking for debugfs_create_dir()
  2023-07-11 11:16 [PATCH v2] lib:Fix more error checking for debugfs_create_dir() Wang Ming
@ 2023-07-11 19:33 ` Randy Dunlap
       [not found]   ` <SG2PR06MB3743963CD8DA3A48FC6C2122BD36A@SG2PR06MB3743.apcprd06.prod.outlook.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2023-07-11 19:33 UTC (permalink / raw
  To: Wang Ming, linux-kernel; +Cc: opensource.kernel

Hi--

On 7/11/23 04:16, Wang Ming wrote:
> In case of failure, debugfs_create_dir() does not return NULL,
> but an error pointer.  Most incorrect error checks were fixed,
> but the one in test_fpu_init() was forgotten.
> 
> Fix the remaining error check.
> 
> Signed-off-by: Wang Ming <machel@vivo.com>

You need to send this to some maintainer who can merge it,
so please an appropriate maintainer to send it to.

Thanks.

> ---
>  lib/test_fpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/test_fpu.c b/lib/test_fpu.c
> index e82db19fed84..5d6aa4691b4a 100644
> --- a/lib/test_fpu.c
> +++ b/lib/test_fpu.c
> @@ -69,7 +69,7 @@ static struct dentry *selftest_dir;
>  static int __init test_fpu_init(void)
>  {
>  	selftest_dir = debugfs_create_dir("selftest_helpers", NULL);
> -	if (!selftest_dir)
> +	if (IS_ERR(selftest_dir))
>  		return -ENOMEM;
>  
>  	debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,

-- 
~Randy

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

* Re: 回复: [PATCH v2] lib:Fix more error checking for debugfs_create_dir()
       [not found]   ` <SG2PR06MB3743963CD8DA3A48FC6C2122BD36A@SG2PR06MB3743.apcprd06.prod.outlook.com>
@ 2023-07-12  2:58     ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2023-07-12  2:58 UTC (permalink / raw
  To: 王明-软件底层技术部,
	LKML
  Cc: opensource.kernel



On 7/11/23 18:20, 王明-软件底层技术部 wrote:
> Hi Randy.
> The only maintainers I obtained using get_maintainer.pl were LKML, and there seems to be no other maintainers
> Do you have any good suggestions?: )
> 

Use 'git log lib/test_fpu.c' to see who merges patches to it.

> ~Ming
> -----邮件原件-----
> 发件人: Randy Dunlap <rdunlap@infradead.org> 
> 发送时间: 2023年7月12日 3:33
> 收件人: 王明-软件底层技术部 <machel@vivo.com>; linux-kernel@vger.kernel.org
> 抄送: opensource.kernel <opensource.kernel@vivo.com>
> 主题: Re: [PATCH v2] lib:Fix more error checking for debugfs_create_dir()
> 
> [Some people who received this message don't often get email from rdunlap@infradead.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hi--
> 
> On 7/11/23 04:16, Wang Ming wrote:
>> In case of failure, debugfs_create_dir() does not return NULL, but an 
>> error pointer.  Most incorrect error checks were fixed, but the one in 
>> test_fpu_init() was forgotten.
>>
>> Fix the remaining error check.
>>
>> Signed-off-by: Wang Ming <machel@vivo.com>
> 
> You need to send this to some maintainer who can merge it, so please an appropriate maintainer to send it to.
> 
> Thanks.
> 
>> ---
>>  lib/test_fpu.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/test_fpu.c b/lib/test_fpu.c index 
>> e82db19fed84..5d6aa4691b4a 100644
>> --- a/lib/test_fpu.c
>> +++ b/lib/test_fpu.c
>> @@ -69,7 +69,7 @@ static struct dentry *selftest_dir;  static int 
>> __init test_fpu_init(void)  {
>>       selftest_dir = debugfs_create_dir("selftest_helpers", NULL);
>> -     if (!selftest_dir)
>> +     if (IS_ERR(selftest_dir))
>>               return -ENOMEM;
>>
>>       debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,
> 
> --
> ~Randy

-- 
~Randy

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

end of thread, other threads:[~2023-07-12  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11 11:16 [PATCH v2] lib:Fix more error checking for debugfs_create_dir() Wang Ming
2023-07-11 19:33 ` Randy Dunlap
     [not found]   ` <SG2PR06MB3743963CD8DA3A48FC6C2122BD36A@SG2PR06MB3743.apcprd06.prod.outlook.com>
2023-07-12  2:58     ` 回复: " Randy Dunlap

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 read-only IMAP folder(s) and NNTP newsgroup(s).