summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2018-01-05 15:58:02 -0800
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-01-15 09:29:48 -0800
commitd4bb86f2c39cdd31338dd0274540596aa9ae82c3 (patch)
treed5b5f9b2584029b957b4c741aa7fef6922fd8a93 /drivers/remoteproc
parent0f21f9cc9d868784c7564edc0cfeddd25ca9621a (diff)
downloadlinux-d4bb86f2c39cdd31338dd0274540596aa9ae82c3.tar.bz2
remoteproc: Don't handle empty resource table
Allow a NULL table_ptr to have the same meaning as a table with 0 entries, allowing a subsequent patch to skip the assignment step. A few other places in the implementation does dereference table_ptr, but they are currently all coming from rproc_handle_resources(). Reviewed-By: Loic Pallardy <loic.pallardy@st.com> Tested-By: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/remoteproc_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 2c669a73e77d..3160cfe897da 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -739,6 +739,9 @@ static int rproc_handle_resources(struct rproc *rproc,
rproc_handle_resource_t handler;
int ret = 0, i;
+ if (!rproc->table_ptr)
+ return 0;
+
for (i = 0; i < rproc->table_ptr->num; i++) {
int offset = rproc->table_ptr->offset[i];
struct fw_rsc_hdr *hdr = (void *)rproc->table_ptr + offset;