mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
qcacmn: Fix align issue for nbuf alloc
Current code it doesn't realize alignment. Eg: if require 4096Bytes, it will alloc 4099Bytes, which cause 2 pages here. Fix is using qdf_align to align memory size. Change-Id: I8eca9a085c0270f47318e64cefba686eac39a69a CRs-Fixed: 2773627
This commit is contained in:
parent
d0a144af3c
commit
3d5a0c6aba
1 changed files with 3 additions and 3 deletions
|
|
@ -401,7 +401,7 @@ struct sk_buff *__qdf_nbuf_alloc(qdf_device_t osdev, size_t size, int reserve,
|
|||
uint32_t lowmem_alloc_tries = 0;
|
||||
|
||||
if (align)
|
||||
size += (align - 1);
|
||||
size = qdf_align(size, align);
|
||||
|
||||
realloc:
|
||||
skb = dev_alloc_skb(size);
|
||||
|
|
@ -474,7 +474,7 @@ struct sk_buff *__qdf_nbuf_alloc(qdf_device_t osdev, size_t size, int reserve,
|
|||
int flags = GFP_KERNEL;
|
||||
|
||||
if (align)
|
||||
size += (align - 1);
|
||||
size = qdf_align(size, align);
|
||||
|
||||
if (in_interrupt() || irqs_disabled() || in_atomic()) {
|
||||
flags = GFP_ATOMIC;
|
||||
|
|
@ -545,7 +545,7 @@ __qdf_nbuf_t __qdf_nbuf_alloc_no_recycler(size_t size, int reserve, int align,
|
|||
unsigned long offset;
|
||||
|
||||
if (align)
|
||||
size += (align - 1);
|
||||
size = qdf_align(size, align);
|
||||
|
||||
nbuf = alloc_skb(size, GFP_ATOMIC);
|
||||
if (!nbuf)
|
||||
|
|
|
|||
Loading…
Reference in a new issue