Skip to content

Commit

Permalink
OPP: fix error checking in opp_migrate_dentry()
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>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
  • Loading branch information
Qi Zheng authored and Viresh Kumar committed Feb 8, 2023
1 parent 68d8ad3 commit eca4c0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/opp/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static void opp_migrate_dentry(struct opp_device *opp_dev,

dentry = debugfs_rename(rootdir, opp_dev->dentry, rootdir,
opp_table->dentry_name);
if (!dentry) {
if (IS_ERR(dentry)) {
dev_err(dev, "%s: Failed to rename link from: %s to %s\n",
__func__, dev_name(opp_dev->dev), dev_name(dev));
return;
Expand Down

0 comments on commit eca4c0e

Please sign in to comment.