Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cde42e07 authored by Sjur Brændeland's avatar Sjur Brændeland Committed by Ohad Ben-Cohen
Browse files

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: default avatarSjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: default avatarIdo Yariv <ido@wizery.com>
[edit subject, minor commit log edit, cc stable]
Signed-off-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
parent 1cd425b6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;