lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] dma: mmp_pdma: fix a memory alloc error
From
2013/7/5 Vinod Koul <vinod.koul@intel.com>:
> On Tue, Jun 18, 2013 at 02:21:58PM +0800, Xiang Wang wrote:
>> From: Xiang Wang <wangx@marvell.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@marvell.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);
> While at it, can you make the flag GFP_NOWAIT. that is the recommendation for
> dmac drivers
>
> --
> ~Vinod

Hi, Vinod
Would you please explain a little more about why we should use
GFP_NOWAIT here? This memory is not dedicated for DMA controller. Do
we have special reasons to use GFP_NOWAIT? Thanks!

--
Regards,
Xiang


\
 
 \ /
  Last update: 2013-07-25 04:41    [W:0.066 / U:1.040 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site