diff options
| author | Souptick Joarder <jrdr.linux@gmail.com> | 2020-09-27 17:08:04 +0200 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-03-22 17:31:58 +0100 |
| commit | 16a5dcf7fbc2f5cd10c1e6264262bfa3832fb7d5 (patch) | |
| tree | 6c80124dd0424c026399b621ceda4a08d2dc7248 /tools/perf/scripts | |
| parent | 491a0b208b15978c2bde9eb1a6b77a5e0eb55ad0 (diff) | |
| download | linux-16a5dcf7fbc2f5cd10c1e6264262bfa3832fb7d5.tar.gz linux-16a5dcf7fbc2f5cd10c1e6264262bfa3832fb7d5.zip | |
media: atomisp: Fixed error handling path
Inside alloc_user_pages() based on flag value either pin_user_pages()
or get_user_pages_fast() will be called. However, these API might fail.
But free_user_pages() called in error handling path doesn't bother
about return value and will try to unpin bo->pgnr pages, which is
incorrect.
Fix this by passing the page_nr to free_user_pages(). If page_nr > 0
pages will be unpinned based on bo->mem_type. This will also take care
of non error handling path.
allocation")
Link: https://lore.kernel.org/linux-media/1601219284-13275-1-git-send-email-jrdr.linux@gmail.com
Fixes: 14a638ab96c5 ("media: atomisp: use pin_user_pages() for memory
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'tools/perf/scripts')
0 files changed, 0 insertions, 0 deletions
