Revert "Don't call lib_free in the kernel code"

This reverts commit 7884c186208346cf989d28241e4c0eb032c98198.
This commit is contained in:
Petro Karashchenko 2023-08-08 00:14:41 +03:00 committed by Tiago Medicci Serrano
parent 5af40a6fa4
commit b3d620152e
9 changed files with 12 additions and 9 deletions

View File

@ -37,6 +37,7 @@
#include <errno.h>
#include <assert.h>
#include <nuttx/lib/lib.h>
#include <nuttx/lib/xorshift128.h>
#include <nuttx/semaphore.h>
#include <nuttx/fs/fs.h>

View File

@ -720,7 +720,7 @@ static int telnet_close(FAR struct file *filep)
}
}
kmm_free(devpath);
lib_free(devpath);
}
for (i = 0; i < CONFIG_TELNET_MAXLCLIENTS; i++)

View File

@ -3542,7 +3542,7 @@ FAR void *gs2200m_register(FAR const char *devpath,
errout:
nxmutex_destroy(&dev->dev_lock);
kmm_free(dev->path);
lib_free(dev->path);
kmm_free(dev);
return NULL;
}

View File

@ -358,7 +358,7 @@ static int _inode_search(FAR struct inode_search_s *desc)
name);
if (ret > 0)
{
kmm_free(desc->buffer);
lib_free(desc->buffer);
desc->buffer = buffer;
relpath = buffer;
ret = OK;

View File

@ -35,6 +35,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/lib/lib.h>
/****************************************************************************
* Pre-processor Definitions
@ -58,7 +59,7 @@
{ \
if ((d)->buffer != NULL) \
{ \
kmm_free((d)->buffer); \
lib_free((d)->buffer); \
(d)->buffer = NULL; \
} \
} \

View File

@ -1770,7 +1770,7 @@ static int unionfs_readdir(FAR struct inode *mountpt,
/* Free the allocated relpath */
kmm_free(relpath);
lib_free(relpath);
/* Check for a duplicate */
@ -1857,7 +1857,7 @@ static int unionfs_readdir(FAR struct inode *mountpt,
/* Free the allocated relpath */
kmm_free(relpath);
lib_free(relpath);
}
}
}

View File

@ -453,7 +453,7 @@ static int dir_close(FAR struct file *filep)
/* Release our references on the contained 'root' inode */
inode_release(inode);
kmm_free(relpath);
lib_free(relpath);
return ret;
}

View File

@ -33,6 +33,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/semaphore.h>
#include <nuttx/fs/fs.h>
#include <nuttx/lib/lib.h>
#include <nuttx/tls.h>
#include "inode/inode.h"

View File

@ -245,7 +245,7 @@ errout:
RELEASE_SEARCH(&newdesc);
if (subdir != NULL)
{
kmm_free(subdir);
lib_free(subdir);
}
return ret;
@ -431,7 +431,7 @@ errout_with_newsearch:
RELEASE_SEARCH(&newdesc);
if (subdir != NULL)
{
kmm_free(subdir);
lib_free(subdir);
}
return ret;