Skip to content

Commit 6d7d3c2

Browse files
LiHuiSong1rafaeljw
authored andcommitted
mailbox: pcc: Reset pcc_chan_count to zero in case of PCC probe failure
Currently, 'pcc_chan_count' is remains set to a non-zero value if PCC subspaces are parsed successfully but something else fail later during the initial PCC probing phase. This will result in pcc_mbox_request_channel trying to access the resources that are not initialised or allocated and may end up in a system crash. Reset pcc_chan_count to 0 when the PCC probe fails in order to prevent the possible issue as described above. Fixes: ce02870 ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe") Signed-off-by: Huisong Li <[email protected]> Reviewed-by: Sudeep Holla <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a10b1c9 commit 6d7d3c2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/mailbox/pcc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ static int __init pcc_init(void)
743743

744744
if (IS_ERR(pcc_pdev)) {
745745
pr_debug("Err creating PCC platform bundle\n");
746+
pcc_chan_count = 0;
746747
return PTR_ERR(pcc_pdev);
747748
}
748749

0 commit comments

Comments
 (0)