linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiang Wang <wangxfdu@gmail.com>
To: Dan Williams <djbw@fb.com>, Vinod Koul <vinod.koul@intel.com>,
	<linux-kernel@vger.kernel.org>
Cc: <cxie4@marvell.com>, Xiang Wang <wangx@marvell.com>
Subject: [PATCH] dma: mmp_pdma: fix a memory alloc error
Date: Tue, 28 May 2013 20:05:13 +0800	[thread overview]
Message-ID: <1369742713-13528-1-git-send-email-wangxfdu@gmail.com> (raw)

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..76a8dcf 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(struct mmp_pdma_phy), GFP_KERNEL);
 	if (pdev->phy == NULL)
 		return -ENOMEM;
 
-- 
1.7.5.4


             reply	other threads:[~2013-05-28 12:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 12:05 Xiang Wang [this message]
2013-05-28 15:43 ` [PATCH] dma: mmp_pdma: fix a memory alloc error Andy Shevchenko
2013-05-31  4:56   ` Xiang Wang
2013-06-17 11:31     ` Xiang Wang
2013-06-17 13:02 ` Vinod Koul
2013-06-18  8:45   ` Xiang Wang

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=1369742713-13528-1-git-send-email-wangxfdu@gmail.com \
    --to=wangxfdu@gmail.com \
    --cc=cxie4@marvell.com \
    --cc=djbw@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    --cc=wangx@marvell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).