2013-05-09 02:02:03

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH] remoteproc: fix error return code in rproc_fw_boot()

From: Wei Yongjun <[email protected]>

Fix to return -EINVAL in the rproc_find_loaded_rsc_table() error handling
case instead of 0, as done elsewhere in this function.

Introduced by commit a2b950ac7b1e6442919ee9e79c4963e134698869
(remoteproc: perserve resource table data).

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/remoteproc/remoteproc_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 022dc63..56e35c6 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -852,8 +852,10 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
* copy this information to device memory.
*/
loaded_table = rproc_find_loaded_rsc_table(rproc, fw);
- if (!loaded_table)
+ if (!loaded_table) {
+ ret = -EINVAL;
goto clean_up;
+ }

memcpy(loaded_table, rproc->cached_table, tablesz);


2013-06-30 08:27:43

by Ohad Ben Cohen

[permalink] [raw]
Subject: Re: [PATCH] remoteproc: fix error return code in rproc_fw_boot()

On Thu, May 9, 2013 at 5:02 AM, Wei Yongjun <[email protected]> wrote:
> From: Wei Yongjun <[email protected]>
>
> Fix to return -EINVAL in the rproc_find_loaded_rsc_table() error handling
> case instead of 0, as done elsewhere in this function.
>
> Introduced by commit a2b950ac7b1e6442919ee9e79c4963e134698869
> (remoteproc: perserve resource table data).
>
> Signed-off-by: Wei Yongjun <[email protected]>

Applying while fixing additional instances of this in the same function. Thanks!