aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2012-11-12 04:13:51 -0500
committerOhad Ben-Cohen <ohad@wizery.com>2012-11-29 03:05:09 -0500
commitdab55bbafdb491ce2c3f2d7136e54101e948b911 (patch)
tree689501537c7f05eb18bd0093aa868ed55fbaaac1 /drivers
parent6f0c0580b70c89094b3422ba81118c7b959c7556 (diff)
remoteproc: fix error path of ->find_vqs
Eliminate an erroneous invocation of rproc_shutdown inside the error path of rproc_virtio_find_vqs. Reported-by: Ido Yariv <ido@wizery.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/remoteproc/remoteproc_virtio.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
index e7a4780e93db..9e198e590675 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -120,15 +120,11 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
120 return vq; 120 return vq;
121} 121}
122 122
123static void rproc_virtio_del_vqs(struct virtio_device *vdev) 123static void __rproc_virtio_del_vqs(struct virtio_device *vdev)
124{ 124{
125 struct virtqueue *vq, *n; 125 struct virtqueue *vq, *n;
126 struct rproc *rproc = vdev_to_rproc(vdev);
127 struct rproc_vring *rvring; 126 struct rproc_vring *rvring;
128 127
129 /* power down the remote processor before deleting vqs */
130 rproc_shutdown(rproc);
131
132 list_for_each_entry_safe(vq, n, &vdev->vqs, list) { 128 list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
133 rvring = vq->priv; 129 rvring = vq->priv;
134 rvring->vq = NULL; 130 rvring->vq = NULL;
@@ -137,6 +133,16 @@ static void rproc_virtio_del_vqs(struct virtio_device *vdev)
137 } 133 }
138} 134}
139 135
136static void rproc_virtio_del_vqs(struct virtio_device *vdev)
137{
138 struct rproc *rproc = vdev_to_rproc(vdev);
139
140 /* power down the remote processor before deleting vqs */
141 rproc_shutdown(rproc);
142
143 __rproc_virtio_del_vqs(vdev);
144}
145
140static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs, 146static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
141 struct virtqueue *vqs[], 147 struct virtqueue *vqs[],
142 vq_callback_t *callbacks[], 148 vq_callback_t *callbacks[],
@@ -163,7 +169,7 @@ static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
163 return 0; 169 return 0;
164 170
165error: 171error:
166 rproc_virtio_del_vqs(vdev); 172 __rproc_virtio_del_vqs(vdev);
167 return ret; 173 return ret;
168} 174}
169 175