Skip to content

Commit

Permalink
remoteproc: Fix wrong rvring index computation
Browse files Browse the repository at this point in the history
Index of rvring is computed using pointer arithmetic. However, since
rvring->rvdev->vring is the base of the vring array, computation
of rvring idx should be reversed. It previously lead to writing at negative
indices in the resource table.

Signed-off-by: Clement Leger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bjorn Andersson <[email protected]>
  • Loading branch information
clementleger authored and andersson committed Nov 12, 2019
1 parent 714cf5e commit 00a0eec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ rproc_parse_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i)
void rproc_free_vring(struct rproc_vring *rvring)
{
struct rproc *rproc = rvring->rvdev->rproc;
int idx = rvring->rvdev->vring - rvring;
int idx = rvring - rvring->rvdev->vring;
struct fw_rsc_vdev *rsc;

idr_remove(&rproc->notifyids, rvring->notifyid);
Expand Down

0 comments on commit 00a0eec

Please sign in to comment.