mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 22:05:08 +00:00
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:
parent
de84da588f
commit
2ffa39c83b
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user