Commit dab55bba authored by Ohad Ben-Cohen's avatar Ohad Ben-Cohen

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: default avatarIdo Yariv <ido@wizery.com>
Signed-off-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
parent 6f0c0580
...@@ -120,15 +120,11 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev, ...@@ -120,15 +120,11 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
return vq; return vq;
} }
static void rproc_virtio_del_vqs(struct virtio_device *vdev) static void __rproc_virtio_del_vqs(struct virtio_device *vdev)
{ {
struct virtqueue *vq, *n; struct virtqueue *vq, *n;
struct rproc *rproc = vdev_to_rproc(vdev);
struct rproc_vring *rvring; struct rproc_vring *rvring;
/* power down the remote processor before deleting vqs */
rproc_shutdown(rproc);
list_for_each_entry_safe(vq, n, &vdev->vqs, list) { list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
rvring = vq->priv; rvring = vq->priv;
rvring->vq = NULL; rvring->vq = NULL;
...@@ -137,6 +133,16 @@ static void rproc_virtio_del_vqs(struct virtio_device *vdev) ...@@ -137,6 +133,16 @@ static void rproc_virtio_del_vqs(struct virtio_device *vdev)
} }
} }
static void rproc_virtio_del_vqs(struct virtio_device *vdev)
{
struct rproc *rproc = vdev_to_rproc(vdev);
/* power down the remote processor before deleting vqs */
rproc_shutdown(rproc);
__rproc_virtio_del_vqs(vdev);
}
static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs, static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
struct virtqueue *vqs[], struct virtqueue *vqs[],
vq_callback_t *callbacks[], vq_callback_t *callbacks[],
...@@ -163,7 +169,7 @@ static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs, ...@@ -163,7 +169,7 @@ static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
return 0; return 0;
error: error:
rproc_virtio_del_vqs(vdev); __rproc_virtio_del_vqs(vdev);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment