Skip to content

Commit

Permalink
regmap: Remove bitrotted module_put()s
Browse files Browse the repository at this point in the history
The conversion to per bus type registration functions means we don't need
to do module_get()s to hold the bus types in memory (their users will link
to them) so we removed all those calls. This left module_put() calls in
the cleanup paths which aren't needed and which cause unbalanced puts if
we ever try to unload anything.

Reported-by: Jonathan Cameron <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
broonie committed Sep 5, 2011
1 parent b33f9cb commit 5204f5e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,11 @@ struct regmap *regmap_init(struct device *dev,
map->work_buf = kmalloc(map->format.buf_size, GFP_KERNEL);
if (map->work_buf == NULL) {
ret = -ENOMEM;
goto err_bus;
goto err_map;
}

return map;

err_bus:
module_put(map->bus->owner);
err_map:
kfree(map);
err:
Expand All @@ -188,7 +186,6 @@ EXPORT_SYMBOL_GPL(regmap_init);
void regmap_exit(struct regmap *map)
{
kfree(map->work_buf);
module_put(map->bus->owner);
kfree(map);
}
EXPORT_SYMBOL_GPL(regmap_exit);
Expand Down

0 comments on commit 5204f5e

Please sign in to comment.