Skip to content

Commit

Permalink
regmap: clean up debugfs if regmap_init fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Warren authored and Mark Brown committed Jun 3, 2012
1 parent f8f5701 commit bfaa25f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit bfaa25f

Please sign in to comment.