summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2020-10-15 21:57:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-05 13:08:45 +0300
commite6786fd18fe2b91a4844f7d1606c50e09d4cebcf (patch)
tree4a55f985c795c4ea5255ff9e6b25118cd5d9d9fe /drivers/nvme
parent2ef6f4bd60411934e3fc2715442c2afe70f84bf3 (diff)
downloadlinux-e6786fd18fe2b91a4844f7d1606c50e09d4cebcf.tar.xz
sgl_alloc_order: fix memory leak
[ Upstream commit b2a182a40278bc5849730e66bca01a762188ed86 ] sgl_alloc_order() can fail when 'length' is large on a memory constrained system. When order > 0 it will potentially be making several multi-page allocations with the later ones more likely to fail than the earlier one. So it is important that sgl_alloc_order() frees up any pages it has obtained before returning NULL. In the case when order > 0 it calls the wrong free page function and leaks. In testing the leak was sufficient to bring down my 8 GiB laptop with OOM. Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/nvme')
0 files changed, 0 insertions, 0 deletions