diff options
| author | Abdun Nihaal <[email protected]> | 2025-06-26 17:28:21 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2025-06-29 21:10:36 +0000 |
| commit | c871c199accb39d0f4cb941ad0dccabfc21e9214 (patch) | |
| tree | c81cb4806ce7b783be87b467df6d6c8435edb9fb /scripts/bpf_doc.py | |
| parent | Linux 6.16-rc4 (diff) | |
| download | kernel-c871c199accb39d0f4cb941ad0dccabfc21e9214.tar.gz kernel-c871c199accb39d0f4cb941ad0dccabfc21e9214.zip | |
regmap: fix potential memory leak of regmap_bus
When __regmap_init() is called from __regmap_init_i2c() and
__regmap_init_spi() (and their devm versions), the bus argument
obtained from regmap_get_i2c_bus() and regmap_get_spi_bus(), may be
allocated using kmemdup() to support quirks. In those cases, the
bus->free_on_exit field is set to true.
However, inside __regmap_init(), buf is not freed on any error path.
This could lead to a memory leak of regmap_bus when __regmap_init()
fails. Fix that by freeing bus on error path when free_on_exit is set.
Fixes: ea030ca68819 ("regmap-i2c: Set regmap max raw r/w from quirks")
Signed-off-by: Abdun Nihaal <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions
