regmap: Fix for v6.16

A fix for a memory leak when we get an error during regmap init for a
 bus that uses free_on_exit to clean up device specific data.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmh8+e8ACgkQJNaLcl1U
 h9BoEgf/f3xq1/K5IpXY94py7SYp/B0BqW34MioS6pmcqm9b9K4HPislBYRpjs9X
 pufXp3T9f4iqWoemLEky+Z3y6Z+C75IeOoav/OmpBEOOEBXIxHnxoXS+Yl6SWxU+
 0rgbk2HJLYaozYBOn8iHE1ODeEitRsFTHoOT8bX14YVj8vbWSUdXFASdOmENi4Vp
 q9MfEpT1eN0BnBMIBBN1QiizQuvYtr5nHLdmvQMjUgByq8q+kRsjdnVoIOFRqEAr
 BIfwqqne+hVG7S03NEMIVIS1t2tYepKKyaHcjrO7qwEwU6i9rfg/VmWuOSfZZIns
 2OmBRHCgySv3Zc4rtTVcpxFmLW+TTA==
 =f82u
 -----END PGP SIGNATURE-----

Merge tag 'regmap-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fix from Mark Brown:
 "A fix for a memory leak when we get an error during regmap init for a
  bus that uses free_on_exit to clean up device specific data"

* tag 'regmap-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: fix potential memory leak of regmap_bus
This commit is contained in:
Linus Torvalds 2025-07-20 08:56:40 -07:00
commit 875dd235ce

View File

@ -1173,6 +1173,8 @@ err_name:
err_map:
kfree(map);
err:
if (bus && bus->free_on_exit)
kfree(bus);
return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(__regmap_init);