Skip to content

Commit

Permalink
bonding: fix error checking in bond_debug_reregister()
Browse files Browse the repository at this point in the history
Since commit ff9fb72 ("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: ff9fb72 ("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>
  • Loading branch information
Qi Zheng authored and Jakub Kicinski committed Feb 4, 2023
1 parent ce93fdb commit cbe8319
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bonding/bond_debugfs.c
Original file line number Diff line number Diff line change
@@ -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");

0 comments on commit cbe8319

Please sign in to comment.