Commit 11819ed2 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman
Browse files

misc: fastrpc: Fix an error handling path in fastrpc_rpmsg_probe()



If of_platform_populate() fails, some resources need to be freed as already
done in the other error handling paths.

Fixes: 278d56f9 ("misc: fastrpc: Reference count channel context")
Fixes: 3abe3ab3 ("misc: fastrpc: add secure domain support")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/b909d2f3273b794ea0f1f78d14bc24affb08ea5f.1669398274.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 895ae5be
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -2316,7 +2316,18 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
	data->domain_id = domain_id;
	data->rpdev = rpdev;

	return of_platform_populate(rdev->of_node, NULL, NULL, rdev);
	err = of_platform_populate(rdev->of_node, NULL, NULL, rdev);
	if (err)
		goto populate_error;

	return 0;

populate_error:
	if (data->fdevice)
		misc_deregister(&data->fdevice->miscdev);
	if (data->secure_fdevice)
		misc_deregister(&data->secure_fdevice->miscdev);

fdev_error:
	kfree(data);
	return err;