All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: gregkh@linuxfoundation.org, rafael@kernel.org,
	j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
	vireshk@kernel.org, nm@ti.com, sboyd@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	netdev@vger.kernel.org, Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH 2/3] bonding: fix error checking in bond_debug_reregister()
Date: Thu,  2 Feb 2023 17:32:55 +0800	[thread overview]
Message-ID: <20230202093256.32458-3-zhengqi.arch@bytedance.com> (raw)
In-Reply-To: <20230202093256.32458-1-zhengqi.arch@bytedance.com>

Since commit ff9fb72bc077 ("debugfs: return error values,
not NULL") changed return value of debugfs_rename() in
error cases from %NULL to %ERR_PTR(-ERROR), we should
also check error values instead of NULL.

Fixes: ff9fb72bc077 ("debugfs: return error values, not NULL")
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/net/bonding/bond_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c
index 4f9b4a18c74c..594094526648 100644
--- a/drivers/net/bonding/bond_debugfs.c
+++ b/drivers/net/bonding/bond_debugfs.c
@@ -76,7 +76,7 @@ void bond_debug_reregister(struct bonding *bond)
 
 	d = debugfs_rename(bonding_debug_root, bond->debug_dir,
 			   bonding_debug_root, bond->dev->name);
-	if (d) {
+	if (!IS_ERR(d)) {
 		bond->debug_dir = d;
 	} else {
 		netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n");
-- 
2.20.1


  parent reply	other threads:[~2023-02-02  9:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02  9:32 [PATCH 0/3] some minor fixes of error checking about debugfs_rename() Qi Zheng
2023-02-02  9:32 ` [PATCH 1/3] debugfs: update comment of debugfs_rename() Qi Zheng
2023-02-02  9:32 ` Qi Zheng [this message]
2023-02-02 18:41   ` [PATCH 2/3] bonding: fix error checking in bond_debug_reregister() Jay Vosburgh
2023-02-02  9:32 ` [PATCH 3/3] PM/OPP: fix error checking in opp_migrate_dentry() Qi Zheng
2023-02-04  3:30 ` [PATCH 0/3] some minor fixes of error checking about debugfs_rename() patchwork-bot+netdevbpf
2023-02-07 10:30   ` Qi Zheng
2023-02-07 18:31     ` Jakub Kicinski
2023-02-08  2:51       ` Qi Zheng
2023-02-08 11:54       ` Greg Kroah-Hartman
2023-02-08 12:05         ` Qi Zheng
2023-02-11  9:06           ` Greg Kroah-Hartman
2023-02-11  9:12             ` Qi Zheng
2023-02-16 12:49               ` Greg Kroah-Hartman

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=20230202093256.32458-3-zhengqi.arch@bytedance.com \
    --to=zhengqi.arch@bytedance.com \
    --cc=andy@greyhouse.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=j.vosburgh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rafael@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vfalico@gmail.com \
    --cc=vireshk@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.