All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Xiang Wang <wangxfdu@gmail.com>
Cc: Dan Williams <djbw@fb.com>,
	linux-kernel@vger.kernel.org, cxie4@marvell.com,
	Xiang Wang <wangx@marvell.com>
Subject: Re: [PATCH v2] dma: mmp_pdma: fix a memory alloc error
Date: Fri, 5 Jul 2013 12:15:49 +0530	[thread overview]
Message-ID: <20130705064549.GD10947@intel.com> (raw)
In-Reply-To: <1371536519-7837-1-git-send-email-wangxfdu@gmail.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

  parent reply	other threads:[~2013-07-05  7:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18  6:21 [PATCH v2] dma: mmp_pdma: fix a memory alloc error Xiang Wang
2013-07-03 12:12 ` Xiang Wang
2013-07-05  6:45 ` Vinod Koul [this message]
2013-07-25  2:22   ` Xiang Wang
2013-07-29  5:29     ` Vinod Koul
2013-08-01  2:27       ` Xiang Wang
2013-08-19  9:17         ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130705064549.GD10947@intel.com \
    --to=vinod.koul@intel.com \
    --cc=cxie4@marvell.com \
    --cc=djbw@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangx@marvell.com \
    --cc=wangxfdu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.