[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACDNBm18qQSPpZJ-XX6ufLvURV3A+2TJu-sXBP8RoarZ4MkmEg@mail.gmail.com>
Date: Wed, 3 Jul 2013 20:12:56 +0800
From: Xiang Wang <wangxfdu@...il.com>
To: Dan Williams <djbw@...com>, Vinod Koul <vinod.koul@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc: Xiang Wang <wangxfdu@...il.com>, cxie4@...vell.com,
Xiang Wang <wangx@...vell.com>
Subject: Re: [PATCH v2] dma: mmp_pdma: fix a memory alloc error
Hi,
Do you have any comments about this patch? Have modified according to
Vinod's advice. Thanks!
2013/6/18 Xiang Wang <wangxfdu@...il.com>:
> From: Xiang Wang <wangx@...vell.com>
>
> pdev->phy is of type "struct mmp_pdma_phy *". But when
> allocating memory for it, "struct mmp_pdma_chan" is used
> by mistake.
>
> Signed-off-by: Xiang Wang <wangx@...vell.com>
> ---
> drivers/dma/mmp_pdma.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
> index c26699f..18ac57f 100644
> --- a/drivers/dma/mmp_pdma.c
> +++ b/drivers/dma/mmp_pdma.c
> @@ -801,7 +801,7 @@ static int mmp_pdma_probe(struct platform_device *op)
> }
>
> pdev->phy = devm_kzalloc(pdev->dev,
> - dma_channels * sizeof(struct mmp_pdma_chan), GFP_KERNEL);
> + dma_channels * sizeof(*pdev->phy), GFP_KERNEL);
> if (pdev->phy == NULL)
> return -ENOMEM;
>
> --
> 1.7.5.4
>
--
Regards,
Xiang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists