Commit 76dfee40 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'remoteproc-3.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc

Pull remoteproc fixes from Ohad Ben-Cohen:
 "Four small remoteproc fixes:
   - Suman fixed an issue that crawled in with the move to the new
     idr_alloc interface in 3.9
   - Dmitry fixed an STE specific memory leak
   - Sjur fixed an error path in the core
   - Rob fixed a Kconfig typo"

* tag 'remoteproc-3.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
  remoteproc: fix FW_CONFIG typo
  remoteproc: fix error path of handle_vdev
  remoteproc/ste: fix memory leak on shutdown
  remoteproc: fix the error check for idr_alloc
parents f011a08c c7426bce
...@@ -4,7 +4,7 @@ menu "Remoteproc drivers" ...@@ -4,7 +4,7 @@ menu "Remoteproc drivers"
config REMOTEPROC config REMOTEPROC
tristate tristate
depends on HAS_DMA depends on HAS_DMA
select FW_CONFIG select FW_LOADER
select VIRTIO select VIRTIO
config OMAP_REMOTEPROC config OMAP_REMOTEPROC
......
...@@ -217,7 +217,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i) ...@@ -217,7 +217,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
* TODO: support predefined notifyids (via resource table) * TODO: support predefined notifyids (via resource table)
*/ */
ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL); ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL);
if (ret) { if (ret < 0) {
dev_err(dev, "idr_alloc failed: %d\n", ret); dev_err(dev, "idr_alloc failed: %d\n", ret);
dma_free_coherent(dev->parent, size, va, dma); dma_free_coherent(dev->parent, size, va, dma);
return ret; return ret;
...@@ -366,10 +366,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, ...@@ -366,10 +366,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
/* it is now safe to add the virtio device */ /* it is now safe to add the virtio device */
ret = rproc_add_virtio_dev(rvdev, rsc->id); ret = rproc_add_virtio_dev(rvdev, rsc->id);
if (ret) if (ret)
goto free_rvdev; goto remove_rvdev;
return 0; return 0;
remove_rvdev:
list_del(&rvdev->node);
free_rvdev: free_rvdev:
kfree(rvdev); kfree(rvdev);
return ret; return ret;
......
...@@ -240,6 +240,8 @@ static int sproc_drv_remove(struct platform_device *pdev) ...@@ -240,6 +240,8 @@ static int sproc_drv_remove(struct platform_device *pdev)
/* Unregister as remoteproc device */ /* Unregister as remoteproc device */
rproc_del(sproc->rproc); rproc_del(sproc->rproc);
dma_free_coherent(sproc->rproc->dev.parent, SPROC_FW_SIZE,
sproc->fw_addr, sproc->fw_dma_addr);
rproc_put(sproc->rproc); rproc_put(sproc->rproc);
mdev->drv_data = NULL; mdev->drv_data = NULL;
...@@ -297,10 +299,13 @@ static int sproc_probe(struct platform_device *pdev) ...@@ -297,10 +299,13 @@ static int sproc_probe(struct platform_device *pdev)
/* Register as a remoteproc device */ /* Register as a remoteproc device */
err = rproc_add(rproc); err = rproc_add(rproc);
if (err) if (err)
goto free_rproc; goto free_mem;
return 0; return 0;
free_mem:
dma_free_coherent(rproc->dev.parent, SPROC_FW_SIZE,
sproc->fw_addr, sproc->fw_dma_addr);
free_rproc: free_rproc:
/* Reset device data upon error */ /* Reset device data upon error */
mdev->drv_data = NULL; mdev->drv_data = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment