diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-30 19:56:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-30 19:56:38 -0500 |
commit | a95251b8bac4a91a43db795a7193545dac65f4f4 (patch) | |
tree | c52c47f84c58eb7fdf862013e1fec6f325ff30ce /drivers | |
parent | b45b161d3242009c0202abe678511d9cbdc6fe97 (diff) | |
parent | dab55bbafdb491ce2c3f2d7136e54101e948b911 (diff) |
Merge tag 'rproc-3.7-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc
Pull remoteproc fix from Ohad Ben-Cohen:
"A single remoteproc fix for an error path issue reported by Ido Yariv."
* tag 'rproc-3.7-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
remoteproc: fix error path of ->find_vqs
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/remoteproc/remoteproc_virtio.c | 18 |
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 | ||
123 | static void rproc_virtio_del_vqs(struct virtio_device *vdev) | 123 | static 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 | ||
136 | static 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 | |||
140 | static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs, | 146 | static 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 | ||
165 | error: | 171 | error: |
166 | rproc_virtio_del_vqs(vdev); | 172 | __rproc_virtio_del_vqs(vdev); |
167 | return ret; | 173 | return ret; |
168 | } | 174 | } |
169 | 175 | ||