mediatek: copy patches-6.1 to patches-6.6
[openwrt/staging/stintel.git] / target / linux / mediatek / patches-6.6 / 830-v6.4-35-thermal-drivers-mediatek-lvts-Fix-parameter-check-in.patch
1 From 5af4904adc8b840987000724977c13c706d3b7d8 Mon Sep 17 00:00:00 2001
2 From: Minjie Du <duminjie@vivo.com>
3 Date: Thu, 13 Jul 2023 12:24:12 +0800
4 Subject: [PATCH 31/42] thermal/drivers/mediatek/lvts: Fix parameter check in
5 lvts_debugfs_init()
6
7 The documentation says "If an error occurs, ERR_PTR(-ERROR) will be
8 returned" but the current code checks against a NULL pointer returned.
9
10 Fix this by checking if IS_ERR().
11
12 Signed-off-by: Minjie Du <duminjie@vivo.com>
13 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
14 Link: https://lore.kernel.org/r/20230713042413.2519-1-duminjie@vivo.com
15 ---
16 drivers/thermal/mediatek/lvts_thermal.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19 --- a/drivers/thermal/mediatek/lvts_thermal.c
20 +++ b/drivers/thermal/mediatek/lvts_thermal.c
21 @@ -201,7 +201,7 @@ static int lvts_debugfs_init(struct devi
22 int i;
23
24 lvts_td->dom_dentry = debugfs_create_dir(dev_name(dev), NULL);
25 - if (!lvts_td->dom_dentry)
26 + if (IS_ERR(lvts_td->dom_dentry))
27 return 0;
28
29 for (i = 0; i < lvts_td->num_lvts_ctrl; i++) {