diff options
| author | Ingo Molnar <mingo@kernel.org> | 2015-01-28 09:30:32 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-01-28 09:30:32 -0500 |
| commit | 41ca5d4e9be11ea6ae040b51d9628a189fd82896 (patch) | |
| tree | f9c35cc37b9622f6cccd91b94548f44b9a534029 /drivers/misc/cxl/file.c | |
| parent | 0fcedc8631ec28ca25d3c0b116e8fa0c19dd5f6d (diff) | |
| parent | 3669ef9fa7d35f573ec9c0e0341b29251c2734a7 (diff) | |
Merge commit 3669ef9fa7d3 ("x86, tls: Interpret an all-zero struct user_desc as 'no segment'") into x86/asm
Pick up the latestest asm fixes before advancing it any further.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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, | |||
| 140 | 140 | ||
| 141 | pr_devel("%s: pe: %i\n", __func__, ctx->pe); | 141 | pr_devel("%s: pe: %i\n", __func__, ctx->pe); |
| 142 | 142 | ||
| 143 | mutex_lock(&ctx->status_mutex); | 143 | /* Do this outside the status_mutex to avoid a circular dependency with |
| 144 | if (ctx->status != OPENED) { | 144 | * the locking in cxl_mmap_fault() */ |
| 145 | rc = -EIO; | ||
| 146 | goto out; | ||
| 147 | } | ||
| 148 | |||
| 149 | if (copy_from_user(&work, uwork, | 145 | if (copy_from_user(&work, uwork, |
| 150 | sizeof(struct cxl_ioctl_start_work))) { | 146 | sizeof(struct cxl_ioctl_start_work))) { |
| 151 | rc = -EFAULT; | 147 | rc = -EFAULT; |
| 152 | goto out; | 148 | goto out; |
| 153 | } | 149 | } |
| 154 | 150 | ||
| 151 | mutex_lock(&ctx->status_mutex); | ||
| 152 | if (ctx->status != OPENED) { | ||
| 153 | rc = -EIO; | ||
| 154 | goto out; | ||
| 155 | } | ||
| 156 | |||
| 155 | /* | 157 | /* |
| 156 | * if any of the reserved fields are set or any of the unused | 158 | * if any of the reserved fields are set or any of the unused |
| 157 | * flags are set it's invalid | 159 | * flags are set it's invalid |
