Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329777
b: refs/heads/master
c: 7168d91
h: refs/heads/master
i:
  329775: bcbe5a9
v: v3
  • Loading branch information
Dan Carpenter authored and Ohad Ben-Cohen committed Oct 2, 2012
1 parent 184d523 commit c992bbe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ed6d29c725c4aead510b5c23f563795b265acf5
refs/heads/master: 7168d914a782086e217214c57ddfc7cc4b738c0c
22 changes: 11 additions & 11 deletions trunk/drivers/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,17 +573,10 @@ static int rproc_handle_carveout(struct rproc *rproc,
dev_dbg(dev, "carveout rsc: da %x, pa %x, len %x, flags %x\n",
rsc->da, rsc->pa, rsc->len, rsc->flags);

mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
if (!mapping) {
dev_err(dev, "kzalloc mapping failed\n");
return -ENOMEM;
}

carveout = kzalloc(sizeof(*carveout), GFP_KERNEL);
if (!carveout) {
dev_err(dev, "kzalloc carveout failed\n");
ret = -ENOMEM;
goto free_mapping;
return -ENOMEM;
}

va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL);
Expand Down Expand Up @@ -613,11 +606,18 @@ static int rproc_handle_carveout(struct rproc *rproc,
* physical address in this case.
*/
if (rproc->domain) {
mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
if (!mapping) {
dev_err(dev, "kzalloc mapping failed\n");
ret = -ENOMEM;
goto dma_free;
}

ret = iommu_map(rproc->domain, rsc->da, dma, rsc->len,
rsc->flags);
if (ret) {
dev_err(dev, "iommu_map failed: %d\n", ret);
goto dma_free;
goto free_mapping;
}

/*
Expand Down Expand Up @@ -662,12 +662,12 @@ static int rproc_handle_carveout(struct rproc *rproc,

return 0;

free_mapping:
kfree(mapping);
dma_free:
dma_free_coherent(dev->parent, rsc->len, va, dma);
free_carv:
kfree(carveout);
free_mapping:
kfree(mapping);
return ret;
}

Expand Down

0 comments on commit c992bbe

Please sign in to comment.