]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ida: Free allocated bitmap in error path
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 2 Apr 2020 18:26:13 +0000 (14:26 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:48:55 +0000 (14:48 +0100)
commit5729d8571678a45f733c8c41042c9196e5c05770
tree48df5e4a797e075655e4d890e20ea99129e2aefe
parent1250659e550fb0d1313f41373208b5c28ec4e024
ida: Free allocated bitmap in error path

BugLink: https://bugs.launchpad.net/bugs/1902115
[ 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: f32f004cddf8 ("ida: Convert to XArray")
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
lib/idr.c
tools/testing/radix-tree/idr-test.c