From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Rajendra Nayak <rnayak@ti.com>
Cc: tony@atomide.com, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] ARM: OMAP: dma: Fix the kfree ordering
Date: Thu, 13 Jun 2013 14:16:47 +0100 [thread overview]
Message-ID: <20130613131647.GS21614@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1371128960-24822-4-git-send-email-rnayak@ti.com>
On Thu, Jun 13, 2013 at 06:39:20PM +0530, Rajendra Nayak wrote:
> diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
> index 8a71f75..8e16503 100644
> --- a/arch/arm/plat-omap/dma.c
> +++ b/arch/arm/plat-omap/dma.c
> @@ -2111,8 +2111,8 @@ exit_dma_irq_fail:
> }
>
> exit_dma_lch_fail:
> - kfree(p);
> kfree(d);
> + kfree(p);
Err.
p = pdev->dev.platform_data;
d = p->dma_attr;
Why is it kfree'ing platform data in the first place? This means that
a failed bind can't be reattempted later. It also means that an unbind
plus rebind in userspace will free the platform data leaving stale
pointers behind.
This is totally nonsense. Don't kfree() data in your driver which you
haven't allocated yourself!
next prev parent reply other threads:[~2013-06-13 13:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 13:09 [PATCH 0/3] minor omap dma fixes Rajendra Nayak
2013-06-13 13:09 ` [PATCH 1/3] ARM: OMAP: dma: Remove the wrong dev_id check Rajendra Nayak
2013-06-13 13:09 ` [PATCH 2/3] ARM: OMAP: dma: Fix the dma_chan_link_map init order Rajendra Nayak
2013-06-13 13:09 ` [PATCH 3/3] ARM: OMAP: dma: Fix the kfree ordering Rajendra Nayak
2013-06-13 13:16 ` Russell King - ARM Linux [this message]
2013-06-13 13:48 ` Rajendra Nayak
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=20130613131647.GS21614@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=rnayak@ti.com \
--cc=tony@atomide.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).