Commit 8700ce0
crypto: ccree - Correctly handle return of sg_nents_for_len
Fix error handling in cc_map_hash_request_update where sg_nents_for_len
return value was assigned to u32, converting negative errors to large
positive values before passing to sg_copy_to_buffer.
Check sg_nents_for_len return value and propagate errors before
assigning to areq_ctx->in_nents.
Fixes: b7ec853 ("crypto: ccree - use std api when possible")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>1 parent e9eb520 commit 8700ce0
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1235 | 1235 | | |
1236 | 1236 | | |
1237 | 1237 | | |
| 1238 | + | |
1238 | 1239 | | |
1239 | 1240 | | |
1240 | 1241 | | |
| |||
1248 | 1249 | | |
1249 | 1250 | | |
1250 | 1251 | | |
1251 | | - | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1252 | 1256 | | |
1253 | 1257 | | |
1254 | 1258 | | |
| |||
0 commit comments