Loading
regmap: kunit: Fix memory leaks in gen_regmap() and gen_raw_regmap()
- Use kunit_kcalloc() to allocate the defaults table so that it will be freed when the test case ends. - kfree() the buf and *data buffers on the error paths. - Use kunit_add_action_or_reset() instead of kunit_add_action() so that if it fails it will call regmap_exit(). Signed-off-by:Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://msgid.link/r/20240411103724.54063-1-rf@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>