Skip to content

Commit 19ad9f2

Browse files
Minjie Dudlezcano
authored andcommitted
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
1 parent 2bba1ac commit 19ad9f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/thermal/mediatek/lvts_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td)
201201
int i;
202202

203203
lvts_td->dom_dentry = debugfs_create_dir(dev_name(dev), NULL);
204-
if (!lvts_td->dom_dentry)
204+
if (IS_ERR(lvts_td->dom_dentry))
205205
return 0;
206206

207207
for (i = 0; i < lvts_td->num_lvts_ctrl; i++) {

0 commit comments

Comments
 (0)