提交 cde42e07 编写于 作者: S Sjur Brændeland 提交者: Ohad Ben-Cohen

remoteproc: fix error path of handle_vdev

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

Cc: stable@vger.kernel.org
Signed-off-by: NSjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: NIdo Yariv <ido@wizery.com>
[edit subject, minor commit log edit, cc stable]
Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
上级 1cd425b6
...@@ -366,10 +366,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, ...@@ -366,10 +366,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
/* it is now safe to add the virtio device */ /* it is now safe to add the virtio device */
ret = rproc_add_virtio_dev(rvdev, rsc->id); ret = rproc_add_virtio_dev(rvdev, rsc->id);
if (ret) if (ret)
goto free_rvdev; goto remove_rvdev;
return 0; return 0;
remove_rvdev:
list_del(&rvdev->node);
free_rvdev: free_rvdev:
kfree(rvdev); kfree(rvdev);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册