mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Fix cases where memory is allocated using malloc()
arch/arm/src/cxd56xx/cxd56_gnss.c, arch/arm/src/xmc4/xmc4_spi.c, crypto/blake2s.c, drivers/lcd/pcf8574_lcd_backpack.c, drivers/lcd/st7032.c User space memory should not be used within the OS and, when it is absolutely necessary to use user-space memory, it should be allocated using kumm_malloc().
This commit is contained in:
committed by
Abdelatif Guettouche
parent
3cad9f498f
commit
2dae970ec6
+3
-2
@@ -52,6 +52,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/crypto/blake2s.h>
|
||||
|
||||
/****************************************************************************
|
||||
@@ -330,7 +331,7 @@ static int blake2s_selftest(void)
|
||||
blake2s_state ctx;
|
||||
int ret = -1;
|
||||
|
||||
in = malloc(1024);
|
||||
in = kmm_malloc(1024);
|
||||
if (!in)
|
||||
{
|
||||
goto out;
|
||||
@@ -372,7 +373,7 @@ static int blake2s_selftest(void)
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
free(in);
|
||||
kmm_free(in);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user