summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorEkansh Gupta <quic_ekangupt@quicinc.com>2024-01-08 17:18:33 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-23 09:51:40 +0100
commit00c48bfbd6b29b8ebf64edd059dbf9e95cedd5b1 (patch)
tree88f881771b3e29db18336bcdd1c55b3a0a63cfff /drivers/misc
parent93b372c39c40cbf179e56621e6bc48240943af69 (diff)
downloadlinux-stable-00c48bfbd6b29b8ebf64edd059dbf9e95cedd5b1.tar.gz
linux-stable-00c48bfbd6b29b8ebf64edd059dbf9e95cedd5b1.tar.bz2
linux-stable-00c48bfbd6b29b8ebf64edd059dbf9e95cedd5b1.zip
misc: fastrpc: Mark all sessions as invalid in cb_remove
commit a4e61de63e34860c36a71d1a364edba16fb6203b upstream. In remoteproc shutdown sequence, rpmsg_remove will get called which would depopulate all the child nodes that have been created during rpmsg_probe. This would result in cb_remove call for all the context banks for the remoteproc. In cb_remove function, session 0 is getting skipped which is not correct as session 0 will never become available again. Add changes to mark session 0 also as invalid. Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model") Cc: stable <stable@kernel.org> Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com> Link: https://lore.kernel.org/r/20240108114833.20480-1-quic_ekangupt@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/fastrpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 1c6c62a7f7f5..03319a1fa97f 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -2191,7 +2191,7 @@ static int fastrpc_cb_remove(struct platform_device *pdev)
int i;
spin_lock_irqsave(&cctx->lock, flags);
- for (i = 1; i < FASTRPC_MAX_SESSIONS; i++) {
+ for (i = 0; i < FASTRPC_MAX_SESSIONS; i++) {
if (cctx->session[i].sid == sess->sid) {
cctx->session[i].valid = false;
cctx->sesscount--;