aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-05-23 18:30:53 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-03 08:13:38 -0400
commitbfaa25f33425db16a942b7c71e396a47581c646d (patch)
treeaf1ef3a7d93e5bfe8e85bee12eeb6318e5ece7b2 /drivers/base
parentf8f5701bdaf9134b1f90e5044a82c66324d2073f (diff)
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 <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regmap.c5
1 files 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,
368 368
369 ret = regcache_init(map, config); 369 ret = regcache_init(map, config);
370 if (ret < 0) 370 if (ret < 0)
371 goto err_free_workbuf; 371 goto err_debugfs;
372 372
373 /* Add a devres resource for dev_get_regmap() */ 373 /* Add a devres resource for dev_get_regmap() */
374 m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL); 374 m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL);
@@ -383,7 +383,8 @@ struct regmap *regmap_init(struct device *dev,
383 383
384err_cache: 384err_cache:
385 regcache_exit(map); 385 regcache_exit(map);
386err_free_workbuf: 386err_debugfs:
387 regmap_debugfs_exit(map);
387 kfree(map->work_buf); 388 kfree(map->work_buf);
388err_map: 389err_map:
389 kfree(map); 390 kfree(map);