From: Sjur Brændeland <sjur.brandel...@stericsson.com>

Remove the vdev entry from the list before freeing it,
otherwise the rproc->vdevs list get corrupted.

Signed-off-by: Sjur Brændeland <sjur.brandel...@stericsson.com>
---
 drivers/remoteproc/remoteproc_core.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c 
b/drivers/remoteproc/remoteproc_core.c
index dd3bfaf..752b507 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -370,10 +370,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct 
fw_rsc_vdev *rsc,
        /* it is now safe to add the virtio device */
        ret = rproc_add_virtio_dev(rvdev, rsc->id);
        if (ret)
-               goto free_rvdev;
+               goto remove_rvdev;
 
        return 0;
 
+remove_rvdev:
+       list_del(&rvdev->node);
 free_rvdev:
        kfree(rvdev);
        return ret;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to