summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2018-10-14 21:59:19 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-15 16:30:37 +0200
commit02d37186331d389bb19257e330c1ed47afe178ba (patch)
tree7fb19e499935cea9c3939dd52bbbd501fae61cae /drivers/staging
parentb1004491c9c2a62a8ca4d939e35b3c21abc8f28a (diff)
staging: gasket: page table: remove dead code in coherent mem alloc
gasket_alloc_coherent_memory() has some unnecessary code related to out of memory checking that will never hit the condition checked, remove. Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/gasket/gasket_page_table.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c
index 2e1de8ad4a2c..985a3a93499d 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -1316,7 +1316,6 @@ int gasket_alloc_coherent_memory(struct gasket_dev *gasket_dev, u64 size,
GFP_KERNEL);
if (!gasket_dev->page_table[index]->coherent_pages)
goto nomem;
- *dma_address = 0;
gasket_dev->coherent_buffer.length_bytes =
PAGE_SIZE * (num_pages);
@@ -1331,15 +1330,12 @@ int gasket_alloc_coherent_memory(struct gasket_dev *gasket_dev, u64 size,
(u64)mem + j * PAGE_SIZE;
}
- if (*dma_address == 0)
- goto nomem;
return 0;
nomem:
- if (mem) {
+ if (mem)
dma_free_coherent(gasket_get_device(gasket_dev),
num_pages * PAGE_SIZE, mem, handle);
- }
kfree(gasket_dev->page_table[index]->coherent_pages);
gasket_dev->page_table[index]->coherent_pages = NULL;