]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
staging: media: atomisp: fix map and vmap leaks in stat buffer allocation
authorHuihui Huang <hhhuang@smu.edu.sg>
Thu, 16 Apr 2026 13:24:50 +0000 (21:24 +0800)
committerSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 20 May 2026 10:21:42 +0000 (13:21 +0300)
commit12ea58282087b9df896fd0a43a92fa83e56b33c9
tree0a41ff8c2e54c968f3660790fdaacf328344603f
parent63c9b7def874b28471c5c75151cb43e8f10a9fa2
staging: media: atomisp: fix map and vmap leaks in stat buffer allocation

There are memory leaks in
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c.

In atomisp_css_allocate_stat_buffers(), s3a_map is allocated by
ia_css_isp_3a_statistics_map_allocate() and its backing memory is
mapped via hmm_vmap(). When dis_buf allocation fails, the error path
frees s3a_data but does not unmap or free s3a_map. Similarly, when
md_buf allocation fails, neither s3a_map nor dvs_map (and their hmm
vmaps) are freed.

Add the missing hmm_vunmap() and map free calls on both error paths,
matching the cleanup order used in atomisp_css_free_3a_buffer() and
atomisp_css_free_dis_buffer().

Signed-off-by: Huihui Huang <hhhuang@smu.edu.sg>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c