goldfish: pipe: ANDROID: add missing check for memory allocated

Bug: 72717639
Change-Id: I9bc8db41f2269c38a259d842ea52bdc0037f3bae
Signed-off-by: Roman Kiryanov <rkir@google.com>
This commit is contained in:
Roman Kiryanov 2018-06-04 18:22:58 -07:00
parent 33467f9a09
commit 6cdd987da8

View file

@ -951,7 +951,8 @@ static int goldfish_pipe_dma_alloc_locked(struct goldfish_pipe *pipe)
dma->dma_size,
&dma->phys_begin,
GFP_KERNEL);
return -ENOMEM;
if (!dma->dma_vaddr)
return -ENOMEM;
dma->phys_end = dma->phys_begin + dma->dma_size;
pipe->dev->dma_alloc_total += dma->dma_size;