This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit eea0f45e0409d511f3c8e34fd435d33a9081b3d9
Author: makejian <[email protected]>
AuthorDate: Mon Sep 22 10:01:56 2025 +0800

    crypto: remove release process in close
    
    The callback parameters are currently passed in by the upper layer, so the 
release process in close should not be performed here.
    
    This prevents double-free issues and ensures proper resource management.
    
    Signed-off-by: makejian <[email protected]>
---
 crypto/cryptodev.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/crypto/cryptodev.c b/crypto/cryptodev.c
index d8c10dd0f4e..ea63a2253af 100644
--- a/crypto/cryptodev.c
+++ b/crypto/cryptodev.c
@@ -872,8 +872,6 @@ static int cryptof_close(FAR struct file *filep)
 {
   FAR struct fcrypt *fcr = filep->f_priv;
   FAR struct csession *cse;
-  FAR struct cryptkop *krp;
-  int i;
 
   while ((cse = TAILQ_FIRST(&fcr->csessions)))
     {
@@ -881,22 +879,6 @@ static int cryptof_close(FAR struct file *filep)
       (void)csefree(cse);
     }
 
-  while ((krp = TAILQ_FIRST(&fcr->crpk_ret)))
-    {
-      TAILQ_REMOVE(&fcr->crpk_ret, krp, krp_next);
-      for (i = 0; i < CRK_MAXPARAM; i++)
-        {
-          if (krp->krp_param[i].crp_p)
-            {
-              explicit_bzero(krp->krp_param[i].crp_p,
-                  (krp->krp_param[i].crp_nbits + 7) / 8);
-              kmm_free(krp->krp_param[i].crp_p);
-            }
-        }
-
-      kmm_free(krp);
-    }
-
   kmm_free(fcr);
   filep->f_priv = NULL;
   return 0;

Reply via email to