Skip to content

Commit

Permalink
mailbox: pcc: Reset pcc_chan_count to zero in case of PCC probe failure
Browse files Browse the repository at this point in the history
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 <lihuisong@huawei.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Huisong Li authored and Rafael J. Wysocki committed Nov 23, 2022
1 parent a10b1c9 commit 6d7d3c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mailbox/pcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ static int __init pcc_init(void)

if (IS_ERR(pcc_pdev)) {
pr_debug("Err creating PCC platform bundle\n");
pcc_chan_count = 0;
return PTR_ERR(pcc_pdev);
}

Expand Down

0 comments on commit 6d7d3c2

Please sign in to comment.