]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
misc: fastrpc: Deregister device nodes properly in error scenarios
authorAnandu Krishnan E <quic_anane@quicinc.com>
Fri, 10 Jan 2025 13:42:37 +0000 (13:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jan 2025 15:17:49 +0000 (16:17 +0100)
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>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20250110134239.123603-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/fastrpc.c

index dd766c8018e4a841e9b380f203e6f300810dd0d6..b116ed068b997f567e359a7a889d8ad8c68015b1 100644 (file)
@@ -2346,7 +2346,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;