[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 2 Feb 2023 17:32:55 +0800
From: Qi Zheng <zhengqi.arch@...edance.com>
To: gregkh@...uxfoundation.org, rafael@...nel.org,
j.vosburgh@...il.com, vfalico@...il.com, andy@...yhouse.net,
vireshk@...nel.org, nm@...com, sboyd@...nel.org
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
netdev@...r.kernel.org, Qi Zheng <zhengqi.arch@...edance.com>
Subject: [PATCH 2/3] bonding: fix error checking in bond_debug_reregister()
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@...edance.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
Powered by blists - more mailing lists