Matching kmem_free() fix for use after free case.
See commit bb01879ebe
for a full
description. This issue should have been addressed in the same
commit but it slipped my mind.
This commit is contained in:
parent
99639e4a13
commit
a1cf80b493
|
@ -126,9 +126,9 @@ extern void vmem_free_debug(void *ptr, size_t size);
|
||||||
|
|
||||||
#else /* DEBUG_KMEM */
|
#else /* DEBUG_KMEM */
|
||||||
|
|
||||||
# define kmem_alloc(size, flags) kmalloc((size), (flags))
|
# define kmem_alloc(size, flags) kmalloc((size), (flags))
|
||||||
# define kmem_zalloc(size, flags) kzalloc((size), (flags))
|
# define kmem_zalloc(size, flags) kzalloc((size), (flags))
|
||||||
# define kmem_free(ptr, size) (kfree(ptr), (void)(size))
|
# define kmem_free(ptr, size) ((void)(size), kfree(ptr))
|
||||||
|
|
||||||
# ifdef HAVE_KMALLOC_NODE
|
# ifdef HAVE_KMALLOC_NODE
|
||||||
# define kmem_alloc_node(size, flags, node) \
|
# define kmem_alloc_node(size, flags, node) \
|
||||||
|
@ -138,8 +138,8 @@ extern void vmem_free_debug(void *ptr, size_t size);
|
||||||
kmalloc((size), (flags))
|
kmalloc((size), (flags))
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# define vmem_alloc(size, flags) __vmalloc((size), ((flags) | \
|
# define vmem_alloc(size, flags) __vmalloc((size), ((flags) | \
|
||||||
__GFP_HIGHMEM), PAGE_KERNEL)
|
__GFP_HIGHMEM), PAGE_KERNEL)
|
||||||
# define vmem_zalloc(size, flags) \
|
# define vmem_zalloc(size, flags) \
|
||||||
({ \
|
({ \
|
||||||
void *_ptr_ = __vmalloc((size),((flags)|__GFP_HIGHMEM),PAGE_KERNEL); \
|
void *_ptr_ = __vmalloc((size),((flags)|__GFP_HIGHMEM),PAGE_KERNEL); \
|
||||||
|
|
Loading…
Reference in New Issue