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: v3.8.7~27 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ccc4026c520728c39ad36cfa8ca960be9aa560fa;p=karo-tx-linux.git remoteproc: fix error path of handle_vdev commit cde42e076c1cdd69a1f955d66ff6596bad3d2105 upstream. Remove the vdev entry from the list before freeing it, otherwise rproc->vdevs will explode. Signed-off-by: Sjur Brændeland Acked-by: Ido Yariv [edit subject, minor commit log edit, cc stable] Signed-off-by: Ohad Ben-Cohen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index dd3bfaf1ad40..752b507ee48d 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;