Skip to content

Commit 2715bb1

Browse files
geertubroonie
authored andcommitted
regulator: core: Fix more error checking for debugfs_create_dir()
In case of failure, debugfs_create_dir() does not return NULL, but an error pointer. Most incorrect error checks were fixed, but the one in create_regulator() was forgotten. Fix the remaining error check. Fixes: 2bf1c45 ("regulator: Fix error checking for debugfs_create_dir") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/ee980a108b5854dd8ce3630f8f673e784e057d17.1685013051.git.geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent b8cabec commit 2715bb1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/regulator/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
19111911

19121912
if (err != -EEXIST)
19131913
regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs);
1914-
if (!regulator->debugfs) {
1914+
if (IS_ERR(regulator->debugfs)) {
19151915
rdev_dbg(rdev, "Failed to create debugfs directory\n");
19161916
} else {
19171917
debugfs_create_u32("uA_load", 0444, regulator->debugfs,

0 commit comments

Comments
 (0)