crypto/cryptodev: fix async callback

Fix incorrect memory management for asynchronous process callbacks.

Ensure callback memory is self-managed to prevent leaks or use-after-free issues.

Signed-off-by: makejian <makejian@xiaomi.com>
This commit is contained in:
makejian
2025-07-30 11:36:23 +08:00
committed by Xiang Xiao
parent 791e223001
commit 3b151ae44b
2 changed files with 29 additions and 18 deletions
+2
View File
@@ -262,6 +262,7 @@ struct crypt_kop
u_int crk_flags;
struct crparam crk_param[CRK_MAXPARAM];
uint32_t crk_reqid;
FAR void *crk_arg; /* callback parameter */
};
#define CRK_MOD_EXP 0
@@ -333,6 +334,7 @@ struct cryptkop
FAR struct fcrypt *krp_fcr;
u_int krp_flags; /* same as cryptop */
uint32_t krp_reqid; /* distinguish tasks in asynchronous calling */
FAR void *krp_opaque;
};
/* Crypto capabilities structure */