summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mailbox/mtk-cmdq-mailbox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index 4e9517efac29..2f6bb66341e4 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -570,7 +570,7 @@ static int cmdq_probe(struct platform_device *pdev)
char clk_id[8];
alias_id = of_alias_get_id(node, clk_name);
- if (alias_id < cmdq->gce_num) {
+ if (alias_id >= 0 && alias_id < cmdq->gce_num) {
snprintf(clk_id, sizeof(clk_id), "%s%d", clk_name, alias_id);
cmdq->clocks[alias_id].id = clk_id;
cmdq->clocks[alias_id].clk = of_clk_get(node, 0);