summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/remoteproc_core.c
diff options
context:
space:
mode:
authorLoic Pallardy <loic.pallardy@st.com>2016-12-14 18:11:00 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2016-12-30 14:15:42 +0300
commitc81c0e0710f031cb09eb7cbf0e75e6754d1d8346 (patch)
treee517c5a8f9c4c359908d192eb64c69acb237938a /drivers/remoteproc/remoteproc_core.c
parent7ce7d89f48834cefece7804d38fc5d85382edf77 (diff)
downloadlinux-c81c0e0710f031cb09eb7cbf0e75e6754d1d8346.tar.xz
remoteproc: fix vdev reference management
Commit 2b45cef5868a ("remoteproc: Further extend the vdev life cycle") extends kref support for vdev management. It introduces a regression when following sequence is executed: rproc_boot --> rproc_shutdown --> rproc_boot Second rproc_boot call crashes on register_virtio_device as device is already existing. Issue is previous vdev is never released when rproc is stop because associated refcount is too high. kref_get introduces is not needed as kref_init already initializes krefcount to 1 because it considers associated variable as used. This introduces a misalignment between kref_get and kref_put calls. Fixes: 2b45cef5868a ("remoteproc: Further extend the vdev life cycle") Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc/remoteproc_core.c')
-rw-r--r--drivers/remoteproc/remoteproc_core.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 9a507e77eced..feb24c43d4c7 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -396,9 +396,6 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
goto unwind_vring_allocations;
}
- /* track the rvdevs list reference */
- kref_get(&rvdev->refcount);
-
list_add_tail(&rvdev->node, &rproc->rvdevs);
rproc_add_subdev(rproc, &rvdev->subdev,