[PATCH v1] drivers: mediatek: fix parameter check in lvts_debugfs_init()

Minjie Du posted 1 patch 1 year, 2 months ago
drivers/thermal/mediatek/lvts_thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v1] drivers: mediatek: fix parameter check in lvts_debugfs_init()
Posted by Minjie Du 1 year, 2 months ago
Make IS_ERR() judge the debugfs_create_dir() function return
in lvts_debugfs_init().

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 drivers/thermal/mediatek/lvts_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index b693fac2d..b46f351d1 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -190,7 +190,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++) {
-- 
2.39.0
Re: [PATCH v1] drivers: mediatek: fix parameter check in lvts_debugfs_init()
Posted by Daniel Lezcano 1 year, 2 months ago
On 13/07/2023 06:24, Minjie Du wrote:
> Make IS_ERR() judge the debugfs_create_dir() function return
> in lvts_debugfs_init().
> 
> Signed-off-by: Minjie Du <duminjie@vivo.com>

Applied (but massaged the changelog)

Thanks for the fix

> ---
>   drivers/thermal/mediatek/lvts_thermal.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index b693fac2d..b46f351d1 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
> @@ -190,7 +190,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++) {

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog