linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/6] i2c/pxa2xx: Add PCI support for PXA I2C controller
Date: Thu, 6 Jan 2011 11:12:31 +0000	[thread overview]
Message-ID: <20110106111231.GD31708@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20110106105051.GA12146@www.tglx.de>

On Thu, Jan 06, 2011 at 11:50:51AM +0100, Sebastian Andrzej Siewior wrote:
> which functions are you talking about? I allocated one piece of memory
> which contained a platform device, ressources, platform data. It looked
> better than allocating multiple small chunks. I registered it with
> platform_device_register() and platform_device_unregister() complained
> about a missing ->release function.

Please see my email where I described the lifetime rules.  Let's say
your module is removed.  In doing so, you call platform_device_unregister()
followed by kfree().  After this, your module is removed from the system
and the memory backing the module code is unmapped.

If something holds a reference to the platform device, then that's just
waiting for an OOPS to happen.  When those references are finally given
up, your release function will be called - but the code has been unmapped.
That's one source of OOPS.  The second source of OOPS is that the platform
device will be dereferenced, but as you've already kfree'd it, the memory
could be used for some other purpose - in which case this manipulation of
what we think is still a platform device is going to corrupt some other
user.

If it hasn't been re-used, hopefully it's been poisoned, so you'll get
an OOPS from that instead.

  reply	other threads:[~2011-01-06 11:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-05 16:50 I2C support for CE4100, v3 Sebastian Andrzej Siewior
2011-01-05 16:50 ` [PATCH 1/6] i2c/pxa: use dynamic register layout Sebastian Andrzej Siewior
2011-01-05 16:50 ` [PATCH 2/6] arm/pxa2xx: reorganize I2C files Sebastian Andrzej Siewior
2011-01-05 16:51 ` [PATCH 3/6] i2c/pxa2xx: Add PCI support for PXA I2C controller Sebastian Andrzej Siewior
2011-01-05 20:21   ` Ben Dooks
2011-01-05 22:18     ` Sebastian Andrzej Siewior
2011-01-14 14:31     ` Sebastian Andrzej Siewior
2011-02-07 17:56       ` Sebastian Andrzej Siewior
2011-02-23  1:14         ` Ben Dooks
2011-01-05 23:03   ` Russell King - ARM Linux
2011-01-05 23:08     ` Greg KH
2011-01-06  9:20       ` Russell King - ARM Linux
2011-01-06 21:57         ` Greg KH
2011-01-07 12:31           ` [PATCH] i2c-pxa2xx: " Sebastian Andrzej Siewior
2011-01-06 10:50       ` [PATCH 3/6] i2c/pxa2xx: " Sebastian Andrzej Siewior
2011-01-06 11:12         ` Russell King - ARM Linux [this message]
2011-01-06 11:50           ` Sebastian Andrzej Siewior
2011-01-07 15:57             ` Grant Likely
2011-01-05 16:51 ` [PATCH 4/6] i2c/pxa2xx: add support for shared IRQ handler Sebastian Andrzej Siewior
2011-01-05 16:51 ` [PATCH 5/6] i2c/pxa2xx: check timeout correctly Sebastian Andrzej Siewior
2011-01-05 16:51 ` [PATCH 6/6] i2c/pxa2xx: pass of_node from platform driver to adapter and publish Sebastian Andrzej Siewior
2011-01-21 19:32   ` Grant Likely
2011-01-05 21:51 ` I2C support for CE4100, v3 Ben Dooks
2011-01-07 11:20   ` Sebastian Andrzej Siewior
  -- strict thread matches above, loose matches on Subject: below --
2010-12-02 20:09 I2C support for CE4100, v2 Sebastian Andrzej Siewior
2010-12-02 20:09 ` [PATCH 3/6] i2c/pxa2xx: Add PCI support for PXA I2C controller Sebastian Andrzej Siewior
2010-12-14 14:35   ` Florian Fainelli
2011-01-05 17:26     ` Sebastian Andrzej Siewior

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=20110106111231.GD31708@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).