diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2015-08-24 15:27:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-20 22:44:51 -0700 |
commit | 5964db08767fb93376c0a0ddcf975fec1c0d1bd9 (patch) | |
tree | 3775375b032efd2b44891a8f5e558dd73e95ad24 /drivers | |
parent | a42fb351ca1f340f8307468be765e3f77ddedda9 (diff) | |
download | linux-5964db08767fb93376c0a0ddcf975fec1c0d1bd9.tar.gz linux-5964db08767fb93376c0a0ddcf975fec1c0d1bd9.tar.bz2 linux-5964db08767fb93376c0a0ddcf975fec1c0d1bd9.zip |
mei: fix debugfs files leak on error path
if dbgfs_dir is not set then debugfs_remove_recursive
is not called on the error path
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/mei/debugfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c index 4b469cf9e60f..8504dbeacd3b 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); |