From: Sjur Brændeland Date: Thu, 21 Feb 2013 17:15:32 +0000 (+0100) Subject: remoteproc: fix error path of handle_vdev X-Git-Tag: accepted/tizen/common/20141203.182822~2530^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cde42e076c1cdd69a1f955d66ff6596bad3d2105;p=platform%2Fkernel%2Flinux-arm64.git 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: Sjur Brændeland Acked-by: Ido Yariv [edit subject, minor commit log edit, cc stable] Signed-off-by: Ohad Ben-Cohen --- diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index fb0fb34..8edb4ae 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -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 */ 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;