Commit e5df1d3e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull rpmsg updates from Bjorn Andersson:
 "This fixes a double free/destroy and drops an unnecessary local
  variable in the rpmsg char driver"

* tag 'rpmsg-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux:
  rpmsg: char: Avoid double destroy of default endpoint
  rpmsg: char: Remove the unneeded result variable
parents 11c747e5 467233a4
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data)

	mutex_lock(&eptdev->ept_lock);
	if (eptdev->ept) {
		/* The default endpoint is released by the rpmsg core */
		if (!eptdev->default_ept)
			rpmsg_destroy_ept(eptdev->ept);
		eptdev->ept = NULL;
	}
@@ -424,15 +426,12 @@ int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent
			       struct rpmsg_channel_info chinfo)
{
	struct rpmsg_eptdev *eptdev;
	int ret;

	eptdev = rpmsg_chrdev_eptdev_alloc(rpdev, parent);
	if (IS_ERR(eptdev))
		return PTR_ERR(eptdev);

	ret = rpmsg_chrdev_eptdev_add(eptdev, chinfo);

	return ret;
	return rpmsg_chrdev_eptdev_add(eptdev, chinfo);
}
EXPORT_SYMBOL(rpmsg_chrdev_eptdev_create);