diff options
Diffstat (limited to 'drivers/misc/sgi-gru/grukdump.c')
-rw-r--r-- | drivers/misc/sgi-gru/grukdump.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/misc/sgi-gru/grukdump.c b/drivers/misc/sgi-gru/grukdump.c index 9b2062d17327..2bef3f76032a 100644 --- a/drivers/misc/sgi-gru/grukdump.c +++ b/drivers/misc/sgi-gru/grukdump.c | |||
@@ -139,8 +139,11 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum, | |||
139 | 139 | ||
140 | ubuf += sizeof(hdr); | 140 | ubuf += sizeof(hdr); |
141 | ubufcch = ubuf; | 141 | ubufcch = ubuf; |
142 | if (gru_user_copy_handle(&ubuf, cch)) | 142 | if (gru_user_copy_handle(&ubuf, cch)) { |
143 | goto fail; | 143 | if (cch_locked) |
144 | unlock_cch_handle(cch); | ||
145 | return -EFAULT; | ||
146 | } | ||
144 | if (cch_locked) | 147 | if (cch_locked) |
145 | ubufcch->delresp = 0; | 148 | ubufcch->delresp = 0; |
146 | bytes = sizeof(hdr) + GRU_CACHE_LINE_BYTES; | 149 | bytes = sizeof(hdr) + GRU_CACHE_LINE_BYTES; |
@@ -179,10 +182,6 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum, | |||
179 | ret = -EFAULT; | 182 | ret = -EFAULT; |
180 | 183 | ||
181 | return ret ? ret : bytes; | 184 | return ret ? ret : bytes; |
182 | |||
183 | fail: | ||
184 | unlock_cch_handle(cch); | ||
185 | return -EFAULT; | ||
186 | } | 185 | } |
187 | 186 | ||
188 | int gru_dump_chiplet_request(unsigned long arg) | 187 | int gru_dump_chiplet_request(unsigned long arg) |