[PATCH v3] misc: fastrpc: Deregister device nodes properly in error scenarios

Anandu Krishnan E posted 1 patch 1 year, 4 months ago
drivers/misc/fastrpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v3] misc: fastrpc: Deregister device nodes properly in error scenarios
Posted by Anandu Krishnan E 1 year, 4 months ago
During fastrpc_rpmsg_probe, if secure device node registration
succeeds but non-secure device node registration fails, the secure
device node deregister is not called during error cleanup. Add proper
exit paths to ensure proper cleanup in case of error.

Fixes: 3abe3ab3cdab ("misc: fastrpc: add secure domain support")
Cc: stable@kernel.org
Signed-off-by: Anandu Krishnan E <quic_anane@quicinc.com>
---
Changes in v3:
 - Resolved checkpatch warning.
 - moved out from patch series to stand-alone patch.
 - Link to v2: https://lore.kernel.org/all/20241223100101.29844-1-quic_anane@quicinc.com/

Changes in v2:
 - Added Fixes: tag and cc:stable.
 - Fixed author name.
 - Link to v1: https://lore.kernel.org/all/20241220061854.24428-1-quic_anane@quicinc.com/

 drivers/misc/fastrpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 48d08eeb2d20..ff144f0aa337 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -2344,7 +2344,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 
 		err = fastrpc_device_register(rdev, data, false, domains[domain_id]);
 		if (err)
-			goto fdev_error;
+			goto populate_error;
 		break;
 	default:
 		err = -EINVAL;
-- 
2.17.1
Re: [PATCH v3] misc: fastrpc: Deregister device nodes properly in error scenarios
Posted by Srinivas Kandagatla 1 year, 4 months ago
On Mon, 30 Dec 2024 17:22:41 +0530, Anandu Krishnan E wrote:
> During fastrpc_rpmsg_probe, if secure device node registration
> succeeds but non-secure device node registration fails, the secure
> device node deregister is not called during error cleanup. Add proper
> exit paths to ensure proper cleanup in case of error.
> 
> 

Applied, thanks!

[1/1] misc: fastrpc: Deregister device nodes properly in error scenarios
      commit: bd79a7dbb3625304abe3086de99168534e9552c5

Best regards,
-- 
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>