Patch "regulator: Fix error checking for debugfs_create_dir" has been added to the 4.14-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

    regulator: Fix error checking for debugfs_create_dir

to the 4.14-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:
     regulator-fix-error-checking-for-debugfs_create_dir.patch
and it can be found in the queue-4.14 subdirectory.

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



commit aff76f16077804e6058bc3fadf46cee5061d6674
Author: Osama Muhammad <osmtendev@xxxxxxxxx>
Date:   Mon May 15 22:29:38 2023 +0500

    regulator: Fix error checking for debugfs_create_dir
    
    [ Upstream commit 2bf1c45be3b8f3a3f898d0756c1282f09719debd ]
    
    This patch fixes the error checking in core.c in debugfs_create_dir.
    The correct way to check if an error occurred is 'IS_ERR' inline function.
    
    Signed-off-by: Osama Muhammad <osmtendev@xxxxxxxxx
    Suggested-by: Ivan Orlov <ivan.orlov0322@xxxxxxxxx
    Link: https://lore.kernel.org/r/20230515172938.13338-1-osmtendev@xxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 871d657a161f0..7898a54a324c4 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3955,7 +3955,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
 	}
 
 	rdev->debugfs = debugfs_create_dir(rname, debugfs_root);
-	if (!rdev->debugfs) {
+	if (IS_ERR(rdev->debugfs)) {
 		rdev_warn(rdev, "Failed to create debugfs directory\n");
 		return;
 	}
@@ -4513,7 +4513,7 @@ static int __init regulator_init(void)
 	ret = class_register(&regulator_class);
 
 	debugfs_root = debugfs_create_dir("regulator", NULL);
-	if (!debugfs_root)
+	if (IS_ERR(debugfs_root))
 		pr_warn("regulator: Failed to create debugfs directory\n");
 
 	debugfs_create_file("supply_map", 0444, debugfs_root, 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