OSDN Git Service

mailbox: mtk-cmdq: Fix local clock ID usage
authorFei Shao <fshao@chromium.org>
Thu, 14 Oct 2021 12:03:52 +0000 (20:03 +0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Tue, 19 Oct 2021 17:28:09 +0000 (12:28 -0500)
commit0a5ad4322927ee4aaba6facc0e4faf1ab6c0d48e
treebd3f9f56ddcffadc42c2bf0bd9632d8582ee17fa
parent5c154b6a51c2d2d7f266b3ef49b7dd1dc8cb5b65
mailbox: mtk-cmdq: Fix local clock ID usage

In the probe function, the clock IDs were pointed to local variables
which should only be used in the same code block, and any access to them
after the probing stage becomes an use-after-free case.

Since there are only limited variants of the gce clock names so far, we
can just declare them as static constants to fix the issue.

Fixes: 85dfdbfc13ea ("mailbox: cmdq: add multi-gce clocks support for mt8195")
Signed-off-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/mtk-cmdq-mailbox.c