public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init()
@ 2023-09-21  9:10 Minjie Du
  2023-09-25 13:45 ` Alexandre Mergnat
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Minjie Du @ 2023-09-21  9:10 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Philipp Zabel, Matthias Brugger, AngeloGioacchino Del Regno,
	Alexandre Mergnat, Nícolas F. R. A. Prado, Minjie Du,
	Chen-Yu Tsai, Balsam CHIHI, open list:THERMAL, open list,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support
  Cc: opensource.kernel

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>
---
 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 effd9b00a424..88240600e6ce 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -213,7 +213,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);
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-28 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21  9:10 [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init() Minjie Du
2023-09-25 13:45 ` Alexandre Mergnat
2023-09-26  4:00 ` Chen-Yu Tsai
2023-09-28 13:59 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox