diff options
Diffstat (limited to 'recipes-connectivity/openssl/openssl-qoriq/qoriq/0020-cryptodev-clean-up-code-layout.patch')
-rw-r--r-- | recipes-connectivity/openssl/openssl-qoriq/qoriq/0020-cryptodev-clean-up-code-layout.patch | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/recipes-connectivity/openssl/openssl-qoriq/qoriq/0020-cryptodev-clean-up-code-layout.patch b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0020-cryptodev-clean-up-code-layout.patch deleted file mode 100644 index d82dc5c3..00000000 --- a/recipes-connectivity/openssl/openssl-qoriq/qoriq/0020-cryptodev-clean-up-code-layout.patch +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | From ac3dfaf10125f08454d51e8fc4b3a77d33fd96d0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Cristian Stoica <cristian.stoica@freescale.com> | ||
3 | Date: Wed, 18 Feb 2015 10:39:46 +0200 | ||
4 | Subject: [PATCH 20/48] cryptodev: clean-up code layout | ||
5 | |||
6 | This is just a refactoring that uses else branch to check for malloc failures | ||
7 | |||
8 | Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
9 | --- | ||
10 | crypto/engine/eng_cryptodev.c | 45 ++++++++++++++++++++----------------------- | ||
11 | 1 file changed, 21 insertions(+), 24 deletions(-) | ||
12 | |||
13 | diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c | ||
14 | index 4d370ad..487a2c9 100644 | ||
15 | --- a/crypto/engine/eng_cryptodev.c | ||
16 | +++ b/crypto/engine/eng_cryptodev.c | ||
17 | @@ -1869,32 +1869,29 @@ cryptodev_asym_async(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen, | ||
18 | fd = *(int *)cookie->eng_handle; | ||
19 | |||
20 | eng_cookie = malloc(sizeof(struct cryptodev_cookie_s)); | ||
21 | - | ||
22 | - if (eng_cookie) { | ||
23 | - memset(eng_cookie, 0, sizeof(struct cryptodev_cookie_s)); | ||
24 | - if (r) { | ||
25 | - kop->crk_param[kop->crk_iparams].crp_p = | ||
26 | - calloc(rlen, sizeof(char)); | ||
27 | - if (!kop->crk_param[kop->crk_iparams].crp_p) | ||
28 | - return -ENOMEM; | ||
29 | - kop->crk_param[kop->crk_iparams].crp_nbits = rlen * 8; | ||
30 | - kop->crk_oparams++; | ||
31 | - eng_cookie->r = r; | ||
32 | - eng_cookie->r_param = kop->crk_param[kop->crk_iparams]; | ||
33 | - } | ||
34 | - if (s) { | ||
35 | - kop->crk_param[kop->crk_iparams + 1].crp_p = | ||
36 | - calloc(slen, sizeof(char)); | ||
37 | - if (!kop->crk_param[kop->crk_iparams + 1].crp_p) | ||
38 | - return -ENOMEM; | ||
39 | - kop->crk_param[kop->crk_iparams + 1].crp_nbits = slen * 8; | ||
40 | - kop->crk_oparams++; | ||
41 | - eng_cookie->s = s; | ||
42 | - eng_cookie->s_param = kop->crk_param[kop->crk_iparams + 1]; | ||
43 | - } | ||
44 | - } else | ||
45 | + if (!eng_cookie) | ||
46 | return -ENOMEM; | ||
47 | |||
48 | + memset(eng_cookie, 0, sizeof(struct cryptodev_cookie_s)); | ||
49 | + if (r) { | ||
50 | + kop->crk_param[kop->crk_iparams].crp_p = calloc(rlen, sizeof(char)); | ||
51 | + if (!kop->crk_param[kop->crk_iparams].crp_p) | ||
52 | + return -ENOMEM; | ||
53 | + kop->crk_param[kop->crk_iparams].crp_nbits = rlen * 8; | ||
54 | + kop->crk_oparams++; | ||
55 | + eng_cookie->r = r; | ||
56 | + eng_cookie->r_param = kop->crk_param[kop->crk_iparams]; | ||
57 | + } | ||
58 | + if (s) { | ||
59 | + kop->crk_param[kop->crk_iparams + 1].crp_p = | ||
60 | + calloc(slen, sizeof(char)); | ||
61 | + if (!kop->crk_param[kop->crk_iparams + 1].crp_p) | ||
62 | + return -ENOMEM; | ||
63 | + kop->crk_param[kop->crk_iparams + 1].crp_nbits = slen * 8; | ||
64 | + kop->crk_oparams++; | ||
65 | + eng_cookie->s = s; | ||
66 | + eng_cookie->s_param = kop->crk_param[kop->crk_iparams + 1]; | ||
67 | + } | ||
68 | eng_cookie->kop = kop; | ||
69 | cookie->eng_cookie = eng_cookie; | ||
70 | return ioctl(fd, CIOCASYMASYNCRYPT, kop); | ||
71 | -- | ||
72 | 2.7.3 | ||
73 | |||