提交 d4bb86f2 编写于 作者: B Bjorn Andersson

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: NLoic Pallardy <loic.pallardy@st.com>
Tested-By: NLoic Pallardy <loic.pallardy@st.com>
Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
上级 0f21f9cc
...@@ -739,6 +739,9 @@ static int rproc_handle_resources(struct rproc *rproc, ...@@ -739,6 +739,9 @@ static int rproc_handle_resources(struct rproc *rproc,
rproc_handle_resource_t handler; rproc_handle_resource_t handler;
int ret = 0, i; int ret = 0, i;
if (!rproc->table_ptr)
return 0;
for (i = 0; i < rproc->table_ptr->num; i++) { for (i = 0; i < rproc->table_ptr->num; i++) {
int offset = rproc->table_ptr->offset[i]; int offset = rproc->table_ptr->offset[i];
struct fw_rsc_hdr *hdr = (void *)rproc->table_ptr + offset; struct fw_rsc_hdr *hdr = (void *)rproc->table_ptr + offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册