mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
ida: Free allocated bitmap in error path
[ Upstream commit a219b856a2b993da234108307be772448f22b0ce ]
If a bitmap needs to be allocated, and then by the time the thread
is scheduled to be run again all the indices which would satisfy the
allocation have been allocated then we would leak the allocation. Almost
impossible to hit in practice, but a trivial fix. Found by Coverity.
Fixes: f32f004cdd ("ida: Convert to XArray")
Reported-by: coverity-bot <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
3789f5cfd6
commit
2577720d35
2 changed files with 30 additions and 0 deletions
|
|
@ -470,6 +470,7 @@ alloc:
|
|||
goto retry;
|
||||
nospc:
|
||||
xas_unlock_irqrestore(&xas, flags);
|
||||
kfree(alloc);
|
||||
return -ENOSPC;
|
||||
}
|
||||
EXPORT_SYMBOL(ida_alloc_range);
|
||||
|
|
|
|||
Loading…
Reference in a new issue