mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
mm/iob: limit the alignment length of IOB to no less than sizeof(uinptr_t)
avoid crashes caused by four-byte alignment issues. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
committed by
Alan C. Assis
parent
776a6a5d0b
commit
48e9b4fc7a
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#ifdef CONFIG_IOB_NOTIFIER
|
||||
# include <nuttx/wqueue.h>
|
||||
@@ -74,9 +75,7 @@
|
||||
|
||||
/* Default config of alignment and head padding size */
|
||||
|
||||
#if !defined(CONFIG_IOB_ALIGNMENT)
|
||||
# define CONFIG_IOB_ALIGNMENT 1
|
||||
#endif
|
||||
#define IOB_ALIGNMENT MAX(CONFIG_IOB_ALIGNMENT, sizeof(uintptr_t))
|
||||
|
||||
/* IOB helpers */
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include <nuttx/queue.h>
|
||||
#include <nuttx/wdog.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/mm/map.h>
|
||||
#include <nuttx/tls.h>
|
||||
#include <nuttx/spinlock_type.h>
|
||||
|
||||
Reference in New Issue
Block a user