diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-12-19 09:40:29 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-12-19 09:40:29 +0000 |
commit | 18c577fbca101a5c16719ae2820616b45c3df493 (patch) | |
tree | ded1a4e8e4b64eb22ddd32ee5da318f2f6d6ee05 /sys/compat/linuxkpi | |
parent | 2b289159de613067e75908b58ed5ba38d6382c92 (diff) | |
download | FreeBSD-src-18c577fbca101a5c16719ae2820616b45c3df493.zip FreeBSD-src-18c577fbca101a5c16719ae2820616b45c3df493.tar.gz |
MFC r309734:
Avoid malloc() warnings when using the LinuxKPI by zero-checking
the allocation flags.
Obtained from: kmacy @
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/compat/linuxkpi')
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/gfp.h | 2 | ||||
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/slab.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h index 374ed79..e1f14b0 100644 --- a/sys/compat/linuxkpi/common/include/linux/gfp.h +++ b/sys/compat/linuxkpi/common/include/linux/gfp.h @@ -64,7 +64,7 @@ #define GFP_IOFS M_NOWAIT #define GFP_NOIO M_NOWAIT #define GFP_DMA32 0 -#define GFP_TEMPORARY 0 +#define GFP_TEMPORARY M_NOWAIT static inline void * page_address(struct page *page) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index f36bc3b..235251c 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -43,7 +43,7 @@ MALLOC_DECLARE(M_KMALLOC); #define kmalloc(size, flags) malloc((size), M_KMALLOC, (flags)) #define kvmalloc(size) kmalloc((size), 0) -#define kzalloc(size, flags) kmalloc((size), (flags) | M_ZERO) +#define kzalloc(size, flags) kmalloc((size), M_ZERO | ((flags) ? (flags) : M_NOWAIT)) #define kzalloc_node(size, flags, node) kzalloc(size, flags) #define kfree(ptr) free(__DECONST(void *, (ptr)), M_KMALLOC) #define kfree_const(ptr) kfree(ptr) |