diff options
author | Fernando Guzman Lugo <fernando.lugo@ti.com> | 2011-06-23 16:04:53 -0500 |
---|---|---|
committer | Fernando Guzman Lugo <fernando.lugo@ti.com> | 2011-06-23 19:28:40 -0500 |
commit | 61bff33dd4bf9aa1ef04f13beb351045efb99455 (patch) | |
tree | 07f026b8c6416401381f3851c24eb66e0d14cc9e | |
parent | 2932297a0c52322929092e3c2443fbe59c42ee2b (diff) | |
download | kernel_samsung_espresso10-61bff33dd4bf9aa1ef04f13beb351045efb99455.zip kernel_samsung_espresso10-61bff33dd4bf9aa1ef04f13beb351045efb99455.tar.gz kernel_samsung_espresso10-61bff33dd4bf9aa1ef04f13beb351045efb99455.tar.bz2 |
RPMSG: RESMGR: miscellaneous fixes
This patch changes:
- Fixed memory leak in rprm_resource_free()
- Fixed missing mutex_unlock in rprm_resource_alloc() in case of
failure
- Move RPMSG_RESMGR option above RPMSG samples in Kconfig (samples
should go at the end
- Chaged to "default y" option in Kconfig file for RPMSG_RESMGR
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
-rw-r--r-- | drivers/remoteproc/Kconfig | 1 | ||||
-rw-r--r-- | drivers/rpmsg/Kconfig | 20 | ||||
-rw-r--r-- | drivers/rpmsg/rpmsg_resmgr.c | 7 |
3 files changed, 15 insertions, 13 deletions
diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 4c6e0ca..bad48eb 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -29,6 +29,7 @@ config OMAP_REMOTE_PROC config OMAP_RPRES bool "Remote Processor Resources" depends on OMAP_REMOTE_PROC + default y help Say Y here if you want to use OMAP remote processor resources frame work. diff --git a/drivers/rpmsg/Kconfig b/drivers/rpmsg/Kconfig index 7c206de..1927ac4 100644 --- a/drivers/rpmsg/Kconfig +++ b/drivers/rpmsg/Kconfig @@ -26,6 +26,16 @@ config RPMSG_OMX If unsure, say N. +config RPMSG_RESMGR + tristate "rpmsg resource manager" + default y + depends on RPMSG + depends on OMAP_RPRES + ---help--- + Add Framework base on RPMSG to request and release resources + from a remote Processor. + Say either Y or M. You know you want to. + config RPMSG_CLIENT_SAMPLE tristate "An rpmsg client sample" default m @@ -41,13 +51,3 @@ config RPMSG_SERVER_SAMPLE ---help--- This is just a sample server driver for the rpmsg bus. Say either Y or M. You know you want to. - -config RPMSG_RESMGR - tristate "rpmsg resource manager" - default y - depends on RPMSG - depends on OMAP_RPRES - ---help--- - Add Framework base on RPMSG to request and release resources - from a remote Processor. - Say either Y or M. You know you want to. diff --git a/drivers/rpmsg/rpmsg_resmgr.c b/drivers/rpmsg/rpmsg_resmgr.c index 73ae976..4b7aa7f 100644 --- a/drivers/rpmsg/rpmsg_resmgr.c +++ b/drivers/rpmsg/rpmsg_resmgr.c @@ -505,8 +505,10 @@ static int rprm_resource_free(struct rprm *rprm, u32 addr, int res_id) out: mutex_unlock(&rprm->lock); - if (!ret) + if (!ret) { ret = _resource_free(e->handle, e->type); + kfree(e); + } return ret; } @@ -569,7 +571,6 @@ static int rprm_resource_alloc(struct rprm *rprm, u32 addr, int *res_id, mutex_lock(&rprm->lock); if (!idr_find(&rprm->conn_list, addr)) { - mutex_unlock(&rprm->lock); ret = -ENOTCONN; goto err; } @@ -578,7 +579,6 @@ static int rprm_resource_alloc(struct rprm *rprm, u32 addr, int *res_id, * remote processor. */ if (!idr_pre_get(&rprm->id_list, GFP_KERNEL)) { - mutex_unlock(&rprm->lock); ret = -ENOMEM; goto err; } @@ -596,6 +596,7 @@ static int rprm_resource_alloc(struct rprm *rprm, u32 addr, int *res_id, return 0; err: + mutex_unlock(&rprm->lock); kfree(e); mem_err: _resource_free(handle, type); |