Since commit 81b3908cf7b9 ("misc: fastrpc: iterate CB nodes manually
instead of of_platform_populate"), the CB devices are created by
fastrpc_cb_devices_create(), but the probe error path still tears them
down with of_platform_depopulate().

Use fastrpc_cb_devices_destroy(), as fastrpc_rpmsg_remove() already
does, so that the sessions are invalidated under the channel lock
before the CB devices are removed.

Fixes: 81b3908cf7b9 ("misc: fastrpc: iterate CB nodes manually instead of 
of_platform_populate")
Co-developed-by: Vinayak Katoch <[email protected]>
Signed-off-by: Vinayak Katoch <[email protected]>
Signed-off-by: Ekansh Gupta <[email protected]>
---
 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 cb0972722e08..ff8a94cc522d 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -2854,7 +2854,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
                fastrpc_notify_users(user);
        spin_unlock_irqrestore(&data->lock, flags);
 
-       of_platform_depopulate(rdev);
+       fastrpc_cb_devices_destroy(rpdev);
        fastrpc_channel_ctx_put(data);
        return err;
 

-- 
2.34.1

Reply via email to