diff options
Diffstat (limited to 'recipes-connectivity/openssl/openssl-fsl/0023-cryptodev-clean-up-code-layout.patch')
-rw-r--r-- | recipes-connectivity/openssl/openssl-fsl/0023-cryptodev-clean-up-code-layout.patch | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/recipes-connectivity/openssl/openssl-fsl/0023-cryptodev-clean-up-code-layout.patch b/recipes-connectivity/openssl/openssl-fsl/0023-cryptodev-clean-up-code-layout.patch deleted file mode 100644 index 5ff1c5ca..00000000 --- a/recipes-connectivity/openssl/openssl-fsl/0023-cryptodev-clean-up-code-layout.patch +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | From 4453b06b940fc03a0973cfd96f908e46cce61054 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 23/26] cryptodev: clean-up code layout | ||
5 | |||
6 | This is just a refactoring that uses else branch to check for malloc failures | ||
7 | |||
8 | Change-Id: I6dc157af36d6ec51a4edfc82cf97fae2e7e83628 | ||
9 | Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
10 | Reviewed-on: http://git.am.freescale.net:8181/34218 | ||
11 | --- | ||
12 | crypto/engine/eng_cryptodev.c | 42 ++++++++++++++++++++---------------------- | ||
13 | 1 file changed, 20 insertions(+), 22 deletions(-) | ||
14 | |||
15 | diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c | ||
16 | index dbc5989..dceb4f5 100644 | ||
17 | --- a/crypto/engine/eng_cryptodev.c | ||
18 | +++ b/crypto/engine/eng_cryptodev.c | ||
19 | @@ -1745,30 +1745,28 @@ cryptodev_asym_async(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen, | ||
20 | fd = *(int *)cookie->eng_handle; | ||
21 | |||
22 | eng_cookie = malloc(sizeof(struct cryptodev_cookie_s)); | ||
23 | - | ||
24 | - if (eng_cookie) { | ||
25 | - memset(eng_cookie, 0, sizeof(struct cryptodev_cookie_s)); | ||
26 | - if (r) { | ||
27 | - kop->crk_param[kop->crk_iparams].crp_p = calloc(rlen, sizeof(char)); | ||
28 | - if (!kop->crk_param[kop->crk_iparams].crp_p) | ||
29 | - return -ENOMEM; | ||
30 | - kop->crk_param[kop->crk_iparams].crp_nbits = rlen * 8; | ||
31 | - kop->crk_oparams++; | ||
32 | - eng_cookie->r = r; | ||
33 | - eng_cookie->r_param = kop->crk_param[kop->crk_iparams]; | ||
34 | - } | ||
35 | - if (s) { | ||
36 | - kop->crk_param[kop->crk_iparams+1].crp_p = 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 = calloc(slen, sizeof(char)); | ||
60 | + if (!kop->crk_param[kop->crk_iparams+1].crp_p) | ||
61 | + return -ENOMEM; | ||
62 | + kop->crk_param[kop->crk_iparams+1].crp_nbits = slen * 8; | ||
63 | + kop->crk_oparams++; | ||
64 | + eng_cookie->s = s; | ||
65 | + eng_cookie->s_param = kop->crk_param[kop->crk_iparams + 1]; | ||
66 | + } | ||
67 | eng_cookie->kop = kop; | ||
68 | cookie->eng_cookie = eng_cookie; | ||
69 | return ioctl(fd, CIOCASYMASYNCRYPT, kop); | ||
70 | -- | ||
71 | 2.3.5 | ||
72 | |||