mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
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
This commit is contained in:
parent
2bba1acf7a
commit
19ad9f2975
|
|
@ -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++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user