summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorRoman Kiryanov <rkir@google.com>2018-06-04 18:22:58 -0700
committerRoman Kiryanov <rkir@google.com>2018-06-04 18:30:10 -0700
commit6cdd987da8a5b293d83e4cd8b168ad1e3b7bc0a7 (patch)
tree319159e29a12d998076dd36dc4967743cd33ebc9 /drivers/platform
parent33467f9a0952ebfee1faf3aba9fdef8b42b9d5c5 (diff)
goldfish: pipe: ANDROID: add missing check for memory allocated
Bug: 72717639 Change-Id: I9bc8db41f2269c38a259d842ea52bdc0037f3bae Signed-off-by: Roman Kiryanov <rkir@google.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/goldfish/goldfish_pipe_v2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/platform/goldfish/goldfish_pipe_v2.c b/drivers/platform/goldfish/goldfish_pipe_v2.c
index 7a53b6b4072d..a904e66c6641 100644
--- a/drivers/platform/goldfish/goldfish_pipe_v2.c
+++ b/drivers/platform/goldfish/goldfish_pipe_v2.c
@@ -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;