diff options
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0022-fix-double-free-pkc-req-on-error.patch')
-rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0022-fix-double-free-pkc-req-on-error.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0022-fix-double-free-pkc-req-on-error.patch b/recipes-kernel/cryptodev/sdk_patches/0022-fix-double-free-pkc-req-on-error.patch new file mode 100644 index 0000000..7bc177e --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0022-fix-double-free-pkc-req-on-error.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 85146b8429ba11bd0be68c24c17dd77b21ec8c25 Mon Sep 17 00:00:00 2001 | ||
2 | From: Cristian Stoica <cristian.stoica@freescale.com> | ||
3 | Date: Mon, 12 Oct 2015 23:03:28 +0300 | ||
4 | Subject: [PATCH 22/38] fix double free pkc->req on error | ||
5 | |||
6 | Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
7 | --- | ||
8 | main.c | 2 +- | ||
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/main.c b/main.c | ||
12 | index e5adb93..ec11129 100644 | ||
13 | --- a/main.c | ||
14 | +++ b/main.c | ||
15 | @@ -747,7 +747,7 @@ int crypto_run_asym(struct cryptodev_pkc *pkc) | ||
16 | /* todo - fix alloc-free on error path */ | ||
17 | pkc->req->type = pkc_req_type; | ||
18 | err = call_next_action(pkc); | ||
19 | - if (pkc->type == SYNCHRONOUS) | ||
20 | + if (err == 0 && pkc->type == SYNCHRONOUS) | ||
21 | kfree(pkc->req); | ||
22 | |||
23 | return err; | ||
24 | -- | ||
25 | 2.7.0 | ||
26 | |||