Commit 112dc91edd51 ("misc: fastrpc: move ADSP duplicate session
creation to the driver") and commit 81b3908cf7b9 ("misc: fastrpc:
iterate CB nodes manually instead of of_platform_populate") were
developed against different layouts of fastrpc_rpmsg_probe(). After
both landed in fastrpc for-next, two parts of the probe still reflect
the layout they were written against.

Patch 1 moves the ADSP duplicate session creation ahead of
fastrpc_device_register(), so the session table is complete and unused
before userspace can open the device. In the current order an open()
can fail with all sessions in use, and a duplicate copied from an
already-allocated session is created with used = true and can never be
freed.

Patch 2 switches the probe error path from of_platform_depopulate() to
fastrpc_cb_devices_destroy(), matching the helper that now creates the
CB devices and that fastrpc_rpmsg_remove() already uses, so the
sessions are invalidated under the channel lock before the CB devices
go away.

Both issues exist only in fastrpc for-next, so no stable backport is
needed. Feel free to squash these into the original commits if you
prefer that over applying them on top.

Signed-off-by: Ekansh Gupta <[email protected]>
---
Ekansh Gupta (2):
      misc: fastrpc: create ADSP duplicate sessions before registering devices
      misc: fastrpc: use fastrpc_cb_devices_destroy() in probe error path

 drivers/misc/fastrpc.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)
---
base-commit: 3680d0d62e9c661e228874cab35346ebd79feaf9
change-id: 20261203-fastrpc-probe-ordering-fix-80c72974d916

Best regards,
--  
Ekansh Gupta <[email protected]>

Reply via email to