diff options
author | Andrew Donnellan <andrew.donnellan@au1.ibm.com> | 2015-09-30 11:58:07 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-10-01 11:50:12 +1000 |
commit | 5f81b95fe2a2de4ec51d46ffd04fa40dfc0cb26a (patch) | |
tree | 5fad6fc50ae3519e92738c5a37736ed76617f14c /fs/romfs | |
parent | 52adee580d3c71a0dfabc3168597421981d68b86 (diff) | |
download | lwn-5f81b95fe2a2de4ec51d46ffd04fa40dfc0cb26a.tar.gz lwn-5f81b95fe2a2de4ec51d46ffd04fa40dfc0cb26a.zip |
cxl: fix leak of ctx->mapping when releasing kernel API contexts
When a context is created via the kernel API, ctx->mapping is allocated
within the kernel and thus needs to be freed when the context is freed.
reclaim_ctx() attempts to do this for contexts with the ctx->kernelapi flag
set, but afu_release() (which can be called from the kernel API through
cxl_fd_release()) sets ctx->mapping to NULL before calling
cxl_context_free() to free the context.
Add a check to afu_release() so that the mappings in contexts created via
the kernel API are left alone so reclaim_ctx() can free them.
Reported-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Fixes: 6f7f0b3df6d4 ("cxl: Add AFU virtual PHB and kernel API")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'fs/romfs')
0 files changed, 0 insertions, 0 deletions