aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIliyan Malchev <malchev@google.com>2011-09-15 17:11:37 -0700
committerIliyan Malchev <malchev@google.com>2011-09-19 16:50:23 -0700
commit249e6831ee95e8e176a7a55b6880d78f9eff09e4 (patch)
treec9cc245848cda762ed284f16a116e9a547a51564
parentf0bc2298e9dd9b68f6841ad035713120884966ba (diff)
downloadkernel_samsung_tuna-249e6831ee95e8e176a7a55b6880d78f9eff09e4.zip
kernel_samsung_tuna-249e6831ee95e8e176a7a55b6880d78f9eff09e4.tar.gz
kernel_samsung_tuna-249e6831ee95e8e176a7a55b6880d78f9eff09e4.tar.bz2
remoteproc: remove debugfs entries on error during resource setup
If rproc_handle_resources() detects an error, we remove the debugfs entries. Otherwise you can crash the kernel by trying to access one of the files. Signed-off-by: Iliyan Malchev <malchev@google.com>
-rw-r--r--drivers/remoteproc/remoteproc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/remoteproc/remoteproc.c b/drivers/remoteproc/remoteproc.c
index 32ebb7a..ccca2bc 100644
--- a/drivers/remoteproc/remoteproc.c
+++ b/drivers/remoteproc/remoteproc.c
@@ -584,6 +584,10 @@ static int rproc_handle_resources(struct rproc *rproc, struct fw_resource *rsc,
}
error:
+ if (ret && rproc->dbg_dir) {
+ debugfs_remove_recursive(rproc->dbg_dir);
+ rproc->dbg_dir = NULL;
+ }
return ret;
}
@@ -913,7 +917,7 @@ static void rproc_error_work(struct work_struct *work)
{
struct rproc *rproc = container_of(work, struct rproc, error_work);
- dev_dbg(rproc->dev, "Enter %s\n", __func__);
+ dev_dbg(rproc->dev, "%s\n", __func__);
_event_notify(rproc, RPROC_ERROR, NULL);
}