cnss: Fix a boundary check bug in cnss prealloc driver
Currently the driver gives a memory slot only if its size is greater than the memory requested by the caller. This will waste a bigger slot if the memory requested is equal to the slot size. Hence fix it by adding the equal check when a memory slot is requested. Change-Id: Ib48477607e9332c8942894301ead606a31fa3284 Signed-off-by: Yue Ma <yuem@codeaurora.org>
This commit is contained in:
parent
3060a9aac4
commit
bf7f76cbc5
1 changed files with 1 additions and 1 deletions
|
@ -157,7 +157,7 @@ void *wcnss_prealloc_get(unsigned int size)
|
||||||
if (wcnss_allocs[i].occupied)
|
if (wcnss_allocs[i].occupied)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (wcnss_allocs[i].size > size) {
|
if (wcnss_allocs[i].size >= size) {
|
||||||
/* we found the slot */
|
/* we found the slot */
|
||||||
wcnss_allocs[i].occupied = 1;
|
wcnss_allocs[i].occupied = 1;
|
||||||
spin_unlock_irqrestore(&alloc_lock, flags);
|
spin_unlock_irqrestore(&alloc_lock, flags);
|
||||||
|
|
Loading…
Add table
Reference in a new issue