Message ID | 20200617163900.17674-1-pierre-louis.bossart@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | regmap: fix memory leak with map->patch | expand |
On Wed, Jun 17, 2020 at 11:39:00AM -0500, Pierre-Louis Bossart wrote: > kmemleak throws the following error on devices using > regmap_register_patch(). map->patch is allocated dynamically with > krealloc() but never freed. Charles sent a patch fixing this already.
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index c472f624382d..46f4b6322e47 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1357,6 +1357,7 @@ void regmap_exit(struct regmap *map) if (map->hwlock) hwspin_lock_free(map->hwlock); kfree_const(map->name); + kfree(map->patch); kfree(map); } EXPORT_SYMBOL_GPL(regmap_exit);