From: Laurent Dufour Date: Wed, 10 Mar 2021 17:44:05 +0000 (+0100) Subject: cxl: don't manipulate the mm.mm_users field directly X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=615d2ef05a97be05c12cbb50f5fce0b8e094d66c;p=linux.git 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 Acked-by: Andrew Donnellan Signed-off-by: Laurent Dufour Link: https://lore.kernel.org/r/20210310174405.51044-1-ldufour@linux.ibm.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c index 01153b74334a1..60c829113299b 100644 --- a/drivers/misc/cxl/fault.c +++ b/drivers/misc/cxl/fault.c @@ -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;