Skip to content

Commit 2ffa39c

Browse files
Minjie Dudlezcano
authored andcommitted
thermal/drivers/mediatek/lvts_thermal: Fix error check in lvts_debugfs_init()
debugfs_create_dir() function returns an error value embedded in the pointer (PTR_ERR). Evaluate the return value using IS_ERR rather than checking for NULL. Signed-off-by: Minjie Du <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent de84da5 commit 2ffa39c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thermal/mediatek/lvts_thermal.c

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

220220
sprintf(name, "controller%d", i);
221221
dentry = debugfs_create_dir(name, lvts_td->dom_dentry);
222-
if (!dentry)
222+
if (IS_ERR(dentry))
223223
continue;
224224

225225
regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL);

0 commit comments

Comments
 (0)