4 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
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRYsGZAAoJELLolMlTRIoMcoYQAMABOWQdyxu3+8sYOiVUQyE8
 /WM0Kw2qRujugqlhvMN8h3DJhmijAcP+P3Lfu3GK5pH6ByzpOEd9rFdT258vbGRl
 ow2uF39UxuiRxoJ/bjtQkoKQM9joYa/LYZ77Z501XWLy7/hcDt2XT4QPciWM7Q31
 COIOidcuqKZpAtITbgwNPkDKzipS/swZloejiApvwR1/gjzL0Cp9M5xm3iGTZUQv
 FH/XDTR4GAT46q6C3jxUB0265hdrYMEYoyero9aWQrdkGNcgTqekXOEueZAVOQLf
 CyOTU7PxFnOJGdmPRNT0D/c0bz4tff8f4jFzAaSiSCoiEPLc2K+ugBa6xYMHJsw2
 waXlkgM3MCVelgVnuPQmYWHc3Yswvi0oNUhIq7AFIMrj6NfAm5OnP6RXRP13g8wd
 nF3J05htpf9u5eIOfv2o5ZueulLdLew9ExDD2Zqd8s64FbFUXIRHqf8f3Lk4HnEd
 qt1WM/bQ9FyKQliQFR8PvGz40vSCz0r/d5/1YMgIGMpRJzDRro0F5a/rSCkQ5lqK
 DsjIvZJYrPJ4BE5296HfUfGi7UKMKwurk2VbctxkjDA4nvKdR7H0G+Iq3qcaeRHr
 GTwxR12CzDX3kgp2cma9iMjwIRHWv8Xte1vGCHURXcbHhWgm6VuxvpzvUqPEFD6q
 13W3n0KSVCwm+LooNMYj
 =+ds4
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2013-04-08 18:53:13 -07:00
commit 76dfee409d
3 changed files with 11 additions and 4 deletions

View file

@ -4,7 +4,7 @@ menu "Remoteproc drivers"
config REMOTEPROC
tristate
depends on HAS_DMA
select FW_CONFIG
select FW_LOADER
select VIRTIO
config OMAP_REMOTEPROC

View file

@ -217,7 +217,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
* TODO: support predefined notifyids (via resource table)
*/
ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL);
if (ret) {
if (ret < 0) {
dev_err(dev, "idr_alloc failed: %d\n", ret);
dma_free_coherent(dev->parent, size, va, dma);
return ret;
@ -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 */
ret = rproc_add_virtio_dev(rvdev, rsc->id);
if (ret)
goto free_rvdev;
goto remove_rvdev;
return 0;
remove_rvdev:
list_del(&rvdev->node);
free_rvdev:
kfree(rvdev);
return ret;

View file

@ -240,6 +240,8 @@ static int sproc_drv_remove(struct platform_device *pdev)
/* Unregister as remoteproc device */
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);
mdev->drv_data = NULL;
@ -297,10 +299,13 @@ static int sproc_probe(struct platform_device *pdev)
/* Register as a remoteproc device */
err = rproc_add(rproc);
if (err)
goto free_rproc;
goto free_mem;
return 0;
free_mem:
dma_free_coherent(rproc->dev.parent, SPROC_FW_SIZE,
sproc->fw_addr, sproc->fw_dma_addr);
free_rproc:
/* Reset device data upon error */
mdev->drv_data = NULL;