diff options
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch')
-rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch b/recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch deleted file mode 100644 index 1e3ebf34..00000000 --- a/recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | From f4534df637b078fce275763bd8bc2a83bfad25e0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Cristian Stoica <cristian.stoica@nxp.com> | ||
3 | Date: Mon, 11 Jan 2016 18:01:06 +0200 | ||
4 | Subject: [PATCH 30/38] remove code duplication in cryptodev_hash_init | ||
5 | |||
6 | cryptodev_hash_init is concerned mostly with allocating data structures | ||
7 | for hash operations. | ||
8 | This patch replaces the call it makes to crypto_ahash_init with | ||
9 | one to cryptodev_hash_reset to avoid code duplication. This call is made | ||
10 | now outside of the original function to increase modularity. | ||
11 | |||
12 | Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com> | ||
13 | --- | ||
14 | cryptlib.c | 9 --------- | ||
15 | ioctl.c | 5 +++++ | ||
16 | 2 files changed, 5 insertions(+), 9 deletions(-) | ||
17 | |||
18 | diff --git a/cryptlib.c b/cryptlib.c | ||
19 | index eba4616..4fd29eb 100644 | ||
20 | --- a/cryptlib.c | ||
21 | +++ b/cryptlib.c | ||
22 | @@ -362,18 +362,9 @@ int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name, | ||
23 | |||
24 | ahash_request_set_callback(hdata->async.request, 0, | ||
25 | cryptodev_complete, hdata->async.result); | ||
26 | - | ||
27 | - ret = crypto_ahash_init(hdata->async.request); | ||
28 | - if (unlikely(ret)) { | ||
29 | - derr(0, "error in crypto_hash_init()"); | ||
30 | - goto error_request; | ||
31 | - } | ||
32 | - | ||
33 | hdata->init = 1; | ||
34 | return 0; | ||
35 | |||
36 | -error_request: | ||
37 | - ahash_request_free(hdata->async.request); | ||
38 | error: | ||
39 | kfree(hdata->async.result); | ||
40 | crypto_free_ahash(hdata->async.s); | ||
41 | diff --git a/ioctl.c b/ioctl.c | ||
42 | index b36dd03..a537886 100644 | ||
43 | --- a/ioctl.c | ||
44 | +++ b/ioctl.c | ||
45 | @@ -338,6 +338,11 @@ crypto_create_session(struct fcrypt *fcr, struct session_op *sop) | ||
46 | ret = -EINVAL; | ||
47 | goto session_error; | ||
48 | } | ||
49 | + | ||
50 | + ret = cryptodev_hash_reset(&ses_new->hdata); | ||
51 | + if (ret != 0) { | ||
52 | + goto session_error; | ||
53 | + } | ||
54 | } | ||
55 | |||
56 | ses_new->alignmask = max(ses_new->cdata.alignmask, | ||
57 | -- | ||
58 | 2.7.0 | ||
59 | |||