Commit 2d9f69bc authored by Laurent Dufour's avatar Laurent Dufour Committed by Michael Ellerman
Browse files

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.

Signed-off-by: default avatarLaurent Dufour <ldufour@linux.ibm.com>
Acked-by: default avatarFrederic Barrat <fbarrat@linux.ibm.com>
Acked-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210310174405.51044-1-ldufour@linux.ibm.com
parent d943bc74
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;