if dbgfs_dir is not set then debugfs_remove_recursive
is not called on the error path

Signed-off-by: Tomas Winkler <tomas.wink...@intel.com>
---
 drivers/misc/mei/debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index c157f0ba575c..a138d8a27ab5 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -204,6 +204,8 @@ int mei_dbgfs_register(struct mei_device *dev, const char 
*name)
        if (!dir)
                return -ENOMEM;
 
+       dev->dbgfs_dir = dir;
+
        f = debugfs_create_file("meclients", S_IRUSR, dir,
                                dev, &mei_dbgfs_fops_meclients);
        if (!f) {
@@ -228,7 +230,6 @@ int mei_dbgfs_register(struct mei_device *dev, const char 
*name)
                dev_err(dev->dev, "allow_fixed_address: registration failed\n");
                goto err;
        }
-       dev->dbgfs_dir = dir;
        return 0;
 err:
        mei_dbgfs_deregister(dev);
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to