diff options
author | Qi Zheng <zhengqi.arch@bytedance.com> | 2023-02-02 17:32:55 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-02-03 19:22:20 -0800 |
commit | cbe83191d40d8925b7a99969d037d2a0caf69294 (patch) | |
tree | 4a046e9dc2de7686bf878fdc1951d2275f5bf8e2 | |
parent | ce93fdb5f2ca5c9e2a9668411cc39091507f8dc9 (diff) | |
download | linux-stable-cbe83191d40d8925b7a99969d037d2a0caf69294.tar.gz linux-stable-cbe83191d40d8925b7a99969d037d2a0caf69294.tar.bz2 linux-stable-cbe83191d40d8925b7a99969d037d2a0caf69294.zip |
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@bytedance.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Link: https://lore.kernel.org/r/20230202093256.32458-1-zhengqi.arch@bytedance.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/bonding/bond_debugfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
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"); |