mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
rk: ion: return appropriate value if iommu map fail
This commit is contained in:
@@ -817,8 +817,8 @@ int ion_map_iommu(struct device *iommu_dev, struct ion_client *client,
|
||||
if (!iommu_map) {
|
||||
pr_debug("%s: create new map for buffer(%p)\n", __func__, buffer);
|
||||
iommu_map = __ion_iommu_map(buffer, iommu_dev, iova);
|
||||
if (!IS_ERR_OR_NULL(iommu_map))
|
||||
ret = -ENOMEM;
|
||||
if (IS_ERR(iommu_map))
|
||||
ret = PTR_ERR(iommu_map);
|
||||
} else {
|
||||
pr_debug("%s: buffer(%p) already mapped\n", __func__, buffer);
|
||||
if (iommu_map->mapped_size != buffer->size) {
|
||||
|
||||
@@ -207,9 +207,9 @@ static int ion_cma_map_iommu(struct ion_buffer *buffer,
|
||||
data->iova_addr = rockchip_iovmm_map(iommu_dev, info->table->sgl, 0, iova_length);
|
||||
pr_debug("%s: map %x -> %lx\n", __func__, info->table->sgl->dma_address,
|
||||
data->iova_addr);
|
||||
if (IS_ERR_OR_NULL(data->iova_addr)) {
|
||||
if (IS_ERR_VALUE(data->iova_addr)) {
|
||||
pr_err("%s: rockchip_iovmm_map() failed: %lx\n", __func__, data->iova_addr);
|
||||
ret = -ENOMEM;
|
||||
ret = data->iova_addr;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -262,9 +262,9 @@ static int ion_system_map_iommu(struct ion_buffer *buffer,
|
||||
|
||||
data->iova_addr = rockchip_iovmm_map(iommu_dev, table->sgl, 0, iova_length);
|
||||
pr_debug("%s: map %x -> %lx\n", __func__, table->sgl->dma_address, data->iova_addr);
|
||||
if (IS_ERR_OR_NULL(data->iova_addr)) {
|
||||
if (IS_ERR_VALUE(data->iova_addr)) {
|
||||
pr_err("%s: rockchip_iovmm_map() failed: %lx\n", __func__, data->iova_addr);
|
||||
ret = -ENOMEM;
|
||||
ret = data->iova_addr;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user