cxl: don't manipulate the mm.mm_users field directly

It is better to rely on the API provided by the MM layer instead of
directly manipulating the mm_users field.

Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Acked-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
Link: https://lore.kernel.org/r/20210310174405.51044-1-ldufour@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Laurent Dufour 2021-03-10 18:44:05 +01:00 committed by Greg Kroah-Hartman
parent 0ea43c23d4
commit 615d2ef05a
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,7 @@ static struct mm_struct *get_mem_context(struct cxl_context *ctx)
if (ctx->mm == NULL)
return NULL;
if (!atomic_inc_not_zero(&ctx->mm->mm_users))
if (!mmget_not_zero(ctx->mm))
return NULL;
return ctx->mm;