diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-01-20 11:03:07 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-01-20 11:03:07 +0100 |
commit | ee65ef609aa81539ac3792df88f04bfe29a77546 (patch) | |
tree | 6816eaa3d45fa1078408f2ccfa5f88d32733d1d9 /drivers/misc/cxl/file.c | |
parent | Documentation: gpio: Add APM X-Gene standby GPIO controller DTS binding (diff) | |
parent | Linux 3.19-rc5 (diff) | |
download | linux-ee65ef609aa81539ac3792df88f04bfe29a77546.tar.xz linux-ee65ef609aa81539ac3792df88f04bfe29a77546.zip |
Merge tag 'v3.19-rc5' into devel
Linux 3.19-rc5
Diffstat (limited to 'drivers/misc/cxl/file.c')
-rw-r--r-- | drivers/misc/cxl/file.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c index e9f2f10dbb37..b15d8113877c 100644 --- a/drivers/misc/cxl/file.c +++ b/drivers/misc/cxl/file.c @@ -140,18 +140,20 @@ static long afu_ioctl_start_work(struct cxl_context *ctx, pr_devel("%s: pe: %i\n", __func__, ctx->pe); - mutex_lock(&ctx->status_mutex); - if (ctx->status != OPENED) { - rc = -EIO; - goto out; - } - + /* Do this outside the status_mutex to avoid a circular dependency with + * the locking in cxl_mmap_fault() */ if (copy_from_user(&work, uwork, sizeof(struct cxl_ioctl_start_work))) { rc = -EFAULT; goto out; } + mutex_lock(&ctx->status_mutex); + if (ctx->status != OPENED) { + rc = -EIO; + goto out; + } + /* * if any of the reserved fields are set or any of the unused * flags are set it's invalid |