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 <duminjie@vivo.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230921091057.3812-1-duminjie@vivo.com
This commit is contained in:
Minjie Du 2023-09-21 17:10:50 +08:00 committed by Daniel Lezcano
parent de84da588f
commit 2ffa39c83b

View File

@ -219,7 +219,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td)
sprintf(name, "controller%d", i);
dentry = debugfs_create_dir(name, lvts_td->dom_dentry);
if (!dentry)
if (IS_ERR(dentry))
continue;
regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL);