summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/sdk_patches/0002-refactoring-relocate-code-to-simplify-later-patches.patch
diff options
context:
space:
mode:
authorChunrong Guo <chunrong.guo@nxp.com>2017-07-28 15:44:09 +0800
committerOtavio Salvador <otavio@ossystems.com.br>2017-08-07 11:42:29 -0300
commitece24e8f9a042561f188d8f09c60b146dd081c94 (patch)
tree1f9b832c30fa2740f16363187493814aca21a3c2 /recipes-kernel/cryptodev/sdk_patches/0002-refactoring-relocate-code-to-simplify-later-patches.patch
parentd586bfdde75ab6cae4f2dcdb63c068e07f4c188e (diff)
downloadmeta-freescale-ece24e8f9a042561f188d8f09c60b146dd081c94.tar.gz
cryptodev-qoriq: update to v1.9
Signed-off-by: Chunrong Guo <B40290@freescale.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0002-refactoring-relocate-code-to-simplify-later-patches.patch')
-rw-r--r--recipes-kernel/cryptodev/sdk_patches/0002-refactoring-relocate-code-to-simplify-later-patches.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0002-refactoring-relocate-code-to-simplify-later-patches.patch b/recipes-kernel/cryptodev/sdk_patches/0002-refactoring-relocate-code-to-simplify-later-patches.patch
new file mode 100644
index 00000000..b948c914
--- /dev/null
+++ b/recipes-kernel/cryptodev/sdk_patches/0002-refactoring-relocate-code-to-simplify-later-patches.patch
@@ -0,0 +1,58 @@
1From c2bf0e42b1d9fda60cde4a3a682784d349ef1c0b Mon Sep 17 00:00:00 2001
2From: Cristian Stoica <cristian.stoica@nxp.com>
3Date: Thu, 4 May 2017 15:06:21 +0300
4Subject: [PATCH 2/9] refactoring: relocate code to simplify later patches
5
6This code move will simplify the conversion to new AEAD interface in
7next patches
8
9Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
10---
11 authenc.c | 17 +++++++++--------
12 1 file changed, 9 insertions(+), 8 deletions(-)
13
14diff --git a/authenc.c b/authenc.c
15index 28eb0f9..95727b4 100644
16--- a/authenc.c
17+++ b/authenc.c
18@@ -711,11 +711,18 @@ static int crypto_auth_zc_aead(struct csession *ses_ptr, struct kernel_crypt_aut
19 return -ENOMEM;
20 }
21
22+ ret = get_userbuf(ses_ptr, caop->src, caop->len, caop->dst, kcaop->dst_len,
23+ kcaop->task, kcaop->mm, &src_sg, &dst_sg);
24+ if (unlikely(ret)) {
25+ derr(1, "get_userbuf(): Error getting user pages.");
26+ goto free_auth_buf;
27+ }
28+
29 if (caop->auth_src && caop->auth_len > 0) {
30 if (unlikely(copy_from_user(auth_buf, caop->auth_src, caop->auth_len))) {
31 derr(1, "unable to copy auth data from userspace.");
32 ret = -EFAULT;
33- goto free_auth_buf;
34+ goto free_pages;
35 }
36
37 sg_init_one(&tmp, auth_buf, caop->auth_len);
38@@ -724,16 +731,10 @@ static int crypto_auth_zc_aead(struct csession *ses_ptr, struct kernel_crypt_aut
39 auth_sg = NULL;
40 }
41
42- ret = get_userbuf(ses_ptr, caop->src, caop->len, caop->dst, kcaop->dst_len,
43- kcaop->task, kcaop->mm, &src_sg, &dst_sg);
44- if (unlikely(ret)) {
45- derr(1, "get_userbuf(): Error getting user pages.");
46- goto free_auth_buf;
47- }
48-
49 ret = auth_n_crypt(ses_ptr, kcaop, auth_sg, caop->auth_len,
50 src_sg, dst_sg, caop->len);
51
52+free_pages:
53 release_user_pages(ses_ptr);
54
55 free_auth_buf:
56--
572.7.4
58