Skip to content

Commit 6667778

Browse files
MaochenWang1dleach02
authored andcommitted
mcux: components: Remove the assert check in the memory function of Zephyr OSA
Remove the assert check in the memory function of Zephyr OSA, as already add the 'p != NULL' check. Signed-off-by: Maochen Wang <[email protected]>
1 parent 16810b4 commit 6667778

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

mcux/mcux-sdk/components/osa/fsl_os_abstraction_zephyr.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ void *OSA_MemoryAllocate(uint32_t memLength)
155155
/* Allocating on the System Heap */
156156
void *p = k_malloc(memLength);
157157

158-
OSA_ASSERT(p != NULL, "Memory of length: %u, could not be allocated\r\n", memLength);
159-
160158
if (p != NULL)
161159
{
162160
(void)memset(p, 0, memLength);
@@ -167,8 +165,6 @@ void *OSA_MemoryAllocate(uint32_t memLength)
167165

168166
void OSA_MemoryFree(void *p)
169167
{
170-
OSA_ASSERT(p != NULL, "Trying to free memory pointing to NULL\r\n");
171-
172168
if (p != NULL)
173169
{
174170
k_free(p);
@@ -180,8 +176,6 @@ void *OSA_MemoryAllocateAlign(uint32_t memLength, uint32_t alignbytes)
180176
/* Allocating on the System Heap */
181177
void *p = k_aligned_alloc(alignbytes, memLength);
182178

183-
OSA_ASSERT(p != NULL, "Memory of length: %u, could not be allocated\r\n", memLength);
184-
185179
if (p != NULL)
186180
{
187181
(void)memset(p, 0, memLength);
@@ -192,8 +186,6 @@ void *OSA_MemoryAllocateAlign(uint32_t memLength, uint32_t alignbytes)
192186

193187
void OSA_MemoryFreeAlign(void *p)
194188
{
195-
OSA_ASSERT(p != NULL, "Trying to free memory pointing to NULL\r\n");
196-
197189
if (p != NULL)
198190
{
199191
k_free(p);

0 commit comments

Comments
 (0)