提交 593d9c2e 编写于 作者: L Laurent Pinchart 提交者: Vinod Koul

dma: mmp_pdma: Fix physical channel memory allocation size

Use sizeof(*var) instead of sizeof(type) when calling devm_k*alloc().
This avoids using the wrong type as was done to allocate the physical
channels array.
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 a2a7c176
...@@ -858,8 +858,7 @@ static int mmp_pdma_chan_init(struct mmp_pdma_device *pdev, int idx, int irq) ...@@ -858,8 +858,7 @@ static int mmp_pdma_chan_init(struct mmp_pdma_device *pdev, int idx, int irq)
struct mmp_pdma_chan *chan; struct mmp_pdma_chan *chan;
int ret; int ret;
chan = devm_kzalloc(pdev->dev, sizeof(struct mmp_pdma_chan), chan = devm_kzalloc(pdev->dev, sizeof(*chan), GFP_KERNEL);
GFP_KERNEL);
if (chan == NULL) if (chan == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -946,8 +945,7 @@ static int mmp_pdma_probe(struct platform_device *op) ...@@ -946,8 +945,7 @@ static int mmp_pdma_probe(struct platform_device *op)
irq_num++; irq_num++;
} }
pdev->phy = devm_kcalloc(pdev->dev, pdev->phy = devm_kcalloc(pdev->dev, dma_channels, sizeof(*pdev->phy),
dma_channels, sizeof(struct mmp_pdma_chan),
GFP_KERNEL); GFP_KERNEL);
if (pdev->phy == NULL) if (pdev->phy == NULL)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册