|
@@ -139,8 +139,11 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum,
|
|
|
|
|
|
ubuf += sizeof(hdr);
|
|
ubuf += sizeof(hdr);
|
|
ubufcch = ubuf;
|
|
ubufcch = ubuf;
|
|
- if (gru_user_copy_handle(&ubuf, cch))
|
|
|
|
- goto fail;
|
|
|
|
|
|
+ if (gru_user_copy_handle(&ubuf, cch)) {
|
|
|
|
+ if (cch_locked)
|
|
|
|
+ unlock_cch_handle(cch);
|
|
|
|
+ return -EFAULT;
|
|
|
|
+ }
|
|
if (cch_locked)
|
|
if (cch_locked)
|
|
ubufcch->delresp = 0;
|
|
ubufcch->delresp = 0;
|
|
bytes = sizeof(hdr) + GRU_CACHE_LINE_BYTES;
|
|
bytes = sizeof(hdr) + GRU_CACHE_LINE_BYTES;
|
|
@@ -179,10 +182,6 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum,
|
|
ret = -EFAULT;
|
|
ret = -EFAULT;
|
|
|
|
|
|
return ret ? ret : bytes;
|
|
return ret ? ret : bytes;
|
|
-
|
|
|
|
-fail:
|
|
|
|
- unlock_cch_handle(cch);
|
|
|
|
- return -EFAULT;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
int gru_dump_chiplet_request(unsigned long arg)
|
|
int gru_dump_chiplet_request(unsigned long arg)
|