ioat: ioat_alloc_ring() failure handling.
authorAlexander.Barabash@dell.com <Alexander.Barabash@dell.com>
Wed, 25 Dec 2019 17:55:30 +0000 (17:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:49:06 +0000 (19:49 +0100)
commit93ed80d6f130cc4a88bc921b92d8164012f70152
tree5aeb595744e59716f1aaf404fe1975581929fd38
parent13dc49dae8a7a7cca74def32c735d3c003a97311
ioat: ioat_alloc_ring() failure handling.

[ Upstream commit b0b5ce1010ffc50015eaec72b0028aaae3f526bb ]

If dma_alloc_coherent() returns NULL in ioat_alloc_ring(), ring
allocation must not proceed.

Until now, if the first call to dma_alloc_coherent() in
ioat_alloc_ring() returned NULL, the processing could proceed, failing
with NULL-pointer dereferencing further down the line.

Signed-off-by: Alexander Barabash <alexander.barabash@dell.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/75e9c0e84c3345d693c606c64f8b9ab5@x13pwhopdag1307.AMER.DELL.COM
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ioat/dma.c