forked from MIrrors/gasket-driver
staging: gasket: page table: use dma_mapping_error for error detection
gasket_perform_mapping() call dma_mapping_error() to determine if mapping failed. Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Alex Van Damme
parent
89ff180f96
commit
72caabea8c
@@ -493,7 +493,8 @@ static int gasket_perform_mapping(struct gasket_page_table *pg_tbl,
|
|||||||
(void *)page_to_pfn(page),
|
(void *)page_to_pfn(page),
|
||||||
(unsigned long long)ptes[i].dma_addr);
|
(unsigned long long)ptes[i].dma_addr);
|
||||||
|
|
||||||
if (ptes[i].dma_addr == -1) {
|
if (dma_mapping_error(pg_tbl->device,
|
||||||
|
ptes[i].dma_addr)) {
|
||||||
dev_dbg(pg_tbl->device,
|
dev_dbg(pg_tbl->device,
|
||||||
"%s i %d -> fail to map page %llx "
|
"%s i %d -> fail to map page %llx "
|
||||||
"[pfn %p ohys %p]\n",
|
"[pfn %p ohys %p]\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user