From: Yang Yingliang Date: Tue, 29 Oct 2024 13:16:28 +0000 (+0800) Subject: mailbox: mtk-cmdq: fix wrong use of sizeof in cmdq_get_clocks() X-Git-Tag: microblaze-v6.16~548^2~7 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=271ee263cc8771982809185007181ca10346fe73;p=linux-2.6-microblaze.git mailbox: mtk-cmdq: fix wrong use of sizeof in cmdq_get_clocks() 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 Signed-off-by: Jassi Brar --- diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index 180906761eda..4324c53e372d 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -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;