summaryrefslogtreecommitdiff
path: root/drivers/misc/cxl/api.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2016-10-29 05:05:25 +0300
committerBrian Norris <computersforpeace@gmail.com>2016-10-29 05:05:25 +0300
commit0e2ce9d3fcba5f92dd6c2b27d82690e49d0c0854 (patch)
treea3413237c8dee15dfe620848fecb37408a096345 /drivers/misc/cxl/api.c
parent30656167bd2347bf867a09cbae2705bd927d3983 (diff)
parent8ff0513bdcdd71e84aa561cce216675d43fb41b8 (diff)
downloadlinux-0e2ce9d3fcba5f92dd6c2b27d82690e49d0c0854.tar.xz
Merge tag 'nand/fixes-for-4.9-rc3' of github.com:linux-nand/linux
From Boris: """ Three simple fixes: - the first one is fixing a non-critical bug in the gpmi driver - the second one is fixing a bug in the 'automatic NAND timings selection' feature introduced in 4.9-rc1 - the last one is fixing a false positive uninitialized-var warning """ Acked-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/misc/cxl/api.c')
-rw-r--r--drivers/misc/cxl/api.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
index f3d34b941f85..af23d7dfe752 100644
--- a/drivers/misc/cxl/api.c
+++ b/drivers/misc/cxl/api.c
@@ -229,6 +229,14 @@ int cxl_start_context(struct cxl_context *ctx, u64 wed,
if (ctx->status == STARTED)
goto out; /* already started */
+ /*
+ * Increment the mapped context count for adapter. This also checks
+ * if adapter_context_lock is taken.
+ */
+ rc = cxl_adapter_context_get(ctx->afu->adapter);
+ if (rc)
+ goto out;
+
if (task) {
ctx->pid = get_task_pid(task, PIDTYPE_PID);
ctx->glpid = get_task_pid(task->group_leader, PIDTYPE_PID);
@@ -240,6 +248,7 @@ int cxl_start_context(struct cxl_context *ctx, u64 wed,
if ((rc = cxl_ops->attach_process(ctx, kernel, wed, 0))) {
put_pid(ctx->pid);
+ cxl_adapter_context_put(ctx->afu->adapter);
cxl_ctx_put();
goto out;
}