]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mailbox: mtk-cmdq: fix wrong use of sizeof in cmdq_get_clocks()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 29 Oct 2024 13:16:28 +0000 (21:16 +0800)
committerJassi Brar <jassisinghbrar@gmail.com>
Sun, 24 Nov 2024 19:02:31 +0000 (13:02 -0600)
It should be size of the struct clk_bulk_data, not data pointer pass to
devm_kcalloc().

Fixes: aa1609f571ca ("mailbox: mtk-cmdq: Dynamically allocate clk_bulk_data structure")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/mtk-cmdq-mailbox.c

index 180906761eda790dc5bfc864a89ecfdc43597305..4324c53e372dfbc7c55c26545176cb20bc10fcfb 100644 (file)
@@ -584,7 +584,7 @@ static int cmdq_get_clocks(struct device *dev, struct cmdq *cmdq)
        struct clk_bulk_data *clks;
 
        cmdq->clocks = devm_kcalloc(dev, cmdq->pdata->gce_num,
-                                   sizeof(cmdq->clocks), GFP_KERNEL);
+                                   sizeof(*cmdq->clocks), GFP_KERNEL);
        if (!cmdq->clocks)
                return -ENOMEM;