diff options
author | Minjie Du | 2023-07-13 12:24:12 +0800 |
---|---|---|
committer | Daniel Lezcano | 2023-08-16 09:54:32 +0200 |
commit | 19ad9f29751ca385262c63f513f75610962c40a0 (patch) | |
tree | cb5cf80337aa6498593409bb69552dab0c748370 /drivers/thermal | |
parent | 2bba1acf7a4cbe62abbb4c686e0414209ec5943b (diff) |
thermal/drivers/mediatek/lvts: Fix parameter check in lvts_debugfs_init()
The documentation says "If an error occurs, ERR_PTR(-ERROR) will be
returned" but the current code checks against a NULL pointer returned.
Fix this by checking if IS_ERR().
Signed-off-by: Minjie Du <duminjie@vivo.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230713042413.2519-1-duminjie@vivo.com
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/mediatek/lvts_thermal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 61c3de44c40b..bc726ac0a672 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -201,7 +201,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td) int i; lvts_td->dom_dentry = debugfs_create_dir(dev_name(dev), NULL); - if (!lvts_td->dom_dentry) + if (IS_ERR(lvts_td->dom_dentry)) return 0; for (i = 0; i < lvts_td->num_lvts_ctrl; i++) { |