From bfaa25f33425db16a942b7c71e396a47581c646d Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 23 May 2012 16:30:53 -0600 Subject: [PATCH] regmap: clean up debugfs if regmap_init fails If debugfs isn't cleaned up, stale files will be left in the filesystem which will cause an OOPS when accessed the first time, and hang the accessing application when accessed again, presumably due to some lock being left held. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- drivers/base/regmap/regmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 0bcda488f11c..2aa076e61367 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -368,7 +368,7 @@ struct regmap *regmap_init(struct device *dev, ret = regcache_init(map, config); if (ret < 0) - goto err_free_workbuf; + goto err_debugfs; /* Add a devres resource for dev_get_regmap() */ m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL); @@ -383,7 +383,8 @@ struct regmap *regmap_init(struct device *dev, err_cache: regcache_exit(map); -err_free_workbuf: +err_debugfs: + regmap_debugfs_exit(map); kfree(map->work_buf); err_map: kfree(map); -- 2.39.5