net:bonding:Fix error checking for debugfs_create_dir()
Subsystems (3)
PATCH 1/1 net:bonding:Fix error checking for debugfs_create_dir()
The debugfs_create_dir() function returns error pointers, it never returns NULL. Most incorrect error checks were fixed, but the one in bond_create_debugfs() was forgotten.
Fix the remaining error check.
--- drivers/net/bonding/bond_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bonding/bond_debugfs.c +1 -1
@@ -88,7 +88,7 @@ void bond_create_debugfs(void) { bonding_debug_root =debugfs_create_dir ("bonding" ,NULL ); -if (!bonding_debug_root) +if (IS_ERR (bonding_debug_root))pr_warn ("Warning: Cannot create bonding directory in debugfs\n" ); }
Signature · 1 line
2.25.1
Quoted 7 lines · Wang Ming
The
debugfs_create_dir()function returns error pointers, it never returns NULL. Most incorrect error checks were fixed, but the one inbond_create_debugfs()was forgotten.Fix the remaining error check.
Signed-off-by Wang Ming <[email protected]>
Seems fine to me; note that almost nobody uses this as bonding
debugfs is hidden behind !CONFIG_NET_NS.
-J
Quoted 22 lines
Fixes 52333512701b ("net: bonding: remove unnecessary braces")---
drivers/net/bonding/bond_debugfs.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/bonding/bond_debugfs.c +1
-1@@ -88,7 +88,7 @@ void bond_create_debugfs(void) { bonding_debug_root =debugfs_create_dir ("bonding" ,NULL ); -if (!bonding_debug_root) +if (IS_ERR (bonding_debug_root))pr_warn ("Warning: Cannot create bonding directory in debugfs\n" ); }Signature · 1 line
2.25.1
王明-软件底层技术部
Acked-by Jay VosburghI think we can remove the check on it, don't you agree? Maybe I should resubmit a new patch Regards
Wang Ming
-----邮件原件-----
发件人: Jay Vosburgh <[email protected]>
发送时间: 2023年7月13日 23:49
收件人: 王明-软件底层技术部 <[email protected]>
抄送: Andy Gospodarek <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Yufeng Mo <[email protected]>; Guangbin Huang <[email protected]>; [email protected]; [email protected]; opensource.kernel <[email protected]> 主题: Re: [PATCH net v1] net:bonding:Fix error checking for debugfs_create_dir()
[????????? [email protected] ????????? https://aka.ms/LearnAboutSenderIdentification?????????????]
Quoted 7 lines · Wang Ming
The
debugfs_create_dir()function returns error pointers, it never returns NULL. Most incorrect error checks were fixed, but the one inbond_create_debugfs()was forgotten.Fix the remaining error check.
Signed-off-by Wang Ming <[email protected]>
Seems fine to me; note that almost nobody uses this as bonding debugfs is hidden behind !CONFIG_NET_NS.
-J
Quoted 22 lines
Fixes 52333512701b ("net: bonding: remove unnecessary braces")---
drivers/net/bonding/bond_debugfs.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/bonding/bond_debugfs.c +1
-2@@ -88,7 +88,7 @@ void bond_create_debugfs(void) { bonding_debug_root =debugfs_create_dir ("bonding" ,NULL ); -if (!bonding_debug_root) +if (IS_ERR (bonding_debug_root))pr_warn ("Warning: Cannot create bonding directory in debugfs\n"); } --2.25.1
Re: [PATCH] net: bonding: Fix error checking for debugfs_create_dir()
In reply to Wang MingQuoted 9 lines
The
debugfs_create_dir()function returns error pointers, it never returns NULL. Most incorrect error checks were fixed, but the one inbond_create_debugfs()was forgotten.Fix the remaining error check.
Signed-off-by Wang Ming <[email protected]>Fixes 52333512701b ("net: bonding: remove unnecessary braces")
Would any other tag ordering be preferred?
How do you think about to use a subject like “[PATCH v2] net: bonding:
Fix an error check in bond_create_debugfs()”?
Regards,
Markus