Patch "thermal/debugfs: Fix the NULL vs IS_ERR() confusion in debugfs_create_dir()" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    thermal/debugfs: Fix the NULL vs IS_ERR() confusion in debugfs_create_dir()

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     thermal-debugfs-fix-the-null-vs-is_err-confusion-in-.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e1fe8197b0f5296d2ec666817f75c5d6b83b8522
Author: Yang Ruibin <11162571@xxxxxxxx>
Date:   Wed Aug 21 03:59:33 2024 -0400

    thermal/debugfs: Fix the NULL vs IS_ERR() confusion in debugfs_create_dir()
    
    [ Upstream commit 57df60e1f981fa8c288a49012a4bbb02ae0ecdbc ]
    
    The debugfs_create_dir() return value is never NULL, it is either a
    valid pointer or an error one.
    
    Use IS_ERR() to check it.
    
    Fixes: 7ef01f228c9f ("thermal/debugfs: Add thermal debugfs information for mitigation episodes")
    Fixes: 755113d76786 ("thermal/debugfs: Add thermal cooling device debugfs information")
    Signed-off-by: Yang Ruibin <11162571@xxxxxxxx>
    Link: https://patch.msgid.link/20240821075934.12145-1-11162571@xxxxxxxx
    [ rjw: Subject and changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/thermal/thermal_debugfs.c b/drivers/thermal/thermal_debugfs.c
index 9424472291570..6d55f5fc4ca0f 100644
--- a/drivers/thermal/thermal_debugfs.c
+++ b/drivers/thermal/thermal_debugfs.c
@@ -178,11 +178,11 @@ struct thermal_debugfs {
 void thermal_debug_init(void)
 {
 	d_root = debugfs_create_dir("thermal", NULL);
-	if (!d_root)
+	if (IS_ERR(d_root))
 		return;
 
 	d_cdev = debugfs_create_dir("cooling_devices", d_root);
-	if (!d_cdev)
+	if (IS_ERR(d_cdev))
 		return;
 
 	d_tz = debugfs_create_dir("thermal_zones", d_root);
@@ -202,7 +202,7 @@ static struct thermal_debugfs *thermal_debugfs_add_id(struct dentry *d, int id)
 	snprintf(ids, IDSLENGTH, "%d", id);
 
 	thermal_dbg->d_top = debugfs_create_dir(ids, d);
-	if (!thermal_dbg->d_top) {
+	if (IS_ERR(thermal_dbg->d_top)) {
 		kfree(thermal_dbg);
 		return NULL;
 	}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux