mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
LinuxKPi: lkpi___kmalloc change a < into <= for proper boundry check
lkpi___kmalloc() would use contigmalloc if the requested size is exactly PAGE_SIZE. But we can still fullfill this request from malloc() without losing the guarantee of physical contiguous memory. Sponsored by: The FreeBSD Foundation Reported by: emaste (in D46656) Fixes:19df0c5abcReviewed by: dumbbell, emaste Differential Revision: https://reviews.freebsd.org/D49570 (cherry picked from commit19efc9e632)
This commit is contained in:
parent
4fc30b0186
commit
d684da076b
1 changed files with 1 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ lkpi___kmalloc(size_t size, gfp_t flags)
|
|||
/* sizeof(struct llist_node) is used for kfree_async(). */
|
||||
_s = MAX(size, sizeof(struct llist_node));
|
||||
|
||||
if (_s < PAGE_SIZE)
|
||||
if (_s <= PAGE_SIZE)
|
||||
return (malloc(_s, M_KMALLOC, linux_check_m_flags(flags)));
|
||||
else
|
||||
return (contigmalloc(_s, M_KMALLOC, linux_check_m_flags(flags),
|
||||
|
|
|
|||
Loading…
Reference in a new issue