Skip to content

Commit 4119a44

Browse files
sudeep-hollaJassi Brar
authored andcommitted
mailbox: pcc: Return early if no GAS register from pcc_mbox_cmd_complete_check
pcc_mbox_cmd_complete_check() accesses pchan->cmd_complete.gas to check command completion status. Even if GAS is NULL, pcc_chan_reg_read() gets called which returns success doing nothing and then we return. Add an early return if pchan->cmd_complete.gas == NULL before performing any operations. Acked-by: Huisong Li <lihuisong@huawei.com> Tested-by: Huisong Li <lihuisong@huawei.com> Tested-by: Adam Young <admiyo@os.amperecomputing.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
1 parent 29237e6 commit 4119a44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/mailbox/pcc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,13 @@ static bool pcc_mbox_cmd_complete_check(struct pcc_chan_info *pchan)
245245
u64 val;
246246
int ret;
247247

248+
if (!pchan->cmd_complete.gas)
249+
return true;
250+
248251
ret = pcc_chan_reg_read(&pchan->cmd_complete, &val);
249252
if (ret)
250253
return false;
251254

252-
if (!pchan->cmd_complete.gas)
253-
return true;
254-
255255
/*
256256
* Judge if the channel respond the interrupt based on the value of
257257
* command complete.

0 commit comments

Comments
 (0)