Ver Fonte

msm: camera: ife: pagefault_ops access protected with mutex_lock

Pagefault_ops is protected by the mutex_lock to avoid the
list corruption by concurrent access via flush calls.

CRs-Fixed: 2904307
Change-Id: Ia6519a382ace7b89b6bd59a2dacfeca3c31e2705
Signed-off-by: Tejas Prajapati <[email protected]>
Tejas Prajapati há 4 anos atrás
pai
commit
1a9a9042d2
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      drivers/cam_core/cam_context.c

+ 3 - 1
drivers/cam_core/cam_context.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -297,6 +297,7 @@ int cam_context_dump_pf_info(struct cam_context *ctx,
 		return -EINVAL;
 	}
 
+	mutex_lock(&ctx->ctx_mutex);
 	if ((ctx->state > CAM_CTX_AVAILABLE) &&
 		(ctx->state < CAM_CTX_STATE_MAX)) {
 		if (ctx->state_machine[ctx->state].pagefault_ops) {
@@ -307,6 +308,7 @@ int cam_context_dump_pf_info(struct cam_context *ctx,
 				ctx->dev_hdl, ctx->state);
 		}
 	}
+	mutex_unlock(&ctx->ctx_mutex);
 
 	return rc;
 }