From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
alan@lxorguk.ukuu.org.uk,
"Andreas Bießmann" <andreas@biessmann.de>,
"Artem Bityutskiy" <artem.bityutskiy@linux.intel.com>,
"David Woodhouse" <David.Woodhouse@intel.com>
Subject: [ 83/84] mtd: omap2: fix omap_nand_remove segfault
Date: Thu, 11 Oct 2012 11:04:07 +0900 [thread overview]
Message-ID: <20121011015432.022856784@linuxfoundation.org> (raw)
In-Reply-To: <20121011015417.017144658@linuxfoundation.org>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Bießmann <andreas@biessmann.de>
commit 7d9b110269253b1d5858cfa57d68dfc7bf50dd77 upstream.
Do not kfree() the mtd_info; it is handled in the mtd subsystem and
already freed by nand_release(). Instead kfree() the struct
omap_nand_info allocated in omap_nand_probe which was not freed before.
This patch fixes following error when unloading the omap2 module:
---8<---
~ $ rmmod omap2
------------[ cut here ]------------
kernel BUG at mm/slab.c:3126!
Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
Modules linked in: omap2(-)
CPU: 0 Not tainted (3.6.0-rc3-00230-g155e36d-dirty #3)
PC is at cache_free_debugcheck+0x2d4/0x36c
LR is at kfree+0xc8/0x2ac
pc : [<c01125a0>] lr : [<c0112efc>] psr: 200d0193
sp : c521fe08 ip : c0e8ef90 fp : c521fe5c
r10: bf0001fc r9 : c521e000 r8 : c0d99c8c
r7 : c661ebc0 r6 : c065d5a4 r5 : c65c4060 r4 : c78005c0
r3 : 00000000 r2 : 00001000 r1 : c65c4000 r0 : 00000001
Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: 86694019 DAC: 00000015
Process rmmod (pid: 549, stack limit = 0xc521e2f0)
Stack: (0xc521fe08 to 0xc5220000)
fe00: c008a874 c00bf44c c515c6d0 200d0193 c65c4860 c515c240
fe20: c521fe3c c521fe30 c008a9c0 c008a854 c521fe5c c65c4860 c78005c0 bf0001fc
fe40: c780ff40 a00d0113 c521e000 00000000 c521fe84 c521fe60 c0112efc c01122d8
fe60: c65c4860 c0673778 c06737ac 00000000 00070013 00000000 c521fe9c c521fe88
fe80: bf0001fc c0112e40 c0673778 bf001ca8 c521feac c521fea0 c02ca11c bf0001ac
fea0: c521fec4 c521feb0 c02c82c4 c02ca100 c0673778 bf001ca8 c521fee4 c521fec8
fec0: c02c8dd8 c02c8250 00000000 bf001ca8 bf001ca8 c0804ee0 c521ff04 c521fee8
fee0: c02c804c c02c8d20 bf001924 00000000 bf001ca8 c521e000 c521ff1c c521ff08
ff00: c02c950c c02c7fbc bf001d48 00000000 c521ff2c c521ff20 c02ca3a4 c02c94b8
ff20: c521ff3c c521ff30 bf001938 c02ca394 c521ffa4 c521ff40 c009beb4 bf001930
ff40: c521ff6c 70616d6f b6fe0032 c0014f84 70616d6f b6fe0032 00000081 60070010
ff60: c521ff84 c521ff70 c008e1f4 c00bf328 0001a004 70616d6f c521ff94 0021ff88
ff80: c008e368 0001a004 70616d6f b6fe0032 00000081 c0015028 00000000 c521ffa8
ffa0: c0014dc0 c009bcd0 0001a004 70616d6f bec2ab38 00000880 bec2ab38 00000880
ffc0: 0001a004 70616d6f b6fe0032 00000081 00000319 00000000 b6fe1000 00000000
ffe0: bec2ab30 bec2ab20 00019f00 b6f539c0 60070010 bec2ab38 aaaaaaaa aaaaaaaa
Backtrace:
[<c01122cc>] (cache_free_debugcheck+0x0/0x36c) from [<c0112efc>] (kfree+0xc8/0x2ac)
[<c0112e34>] (kfree+0x0/0x2ac) from [<bf0001fc>] (omap_nand_remove+0x5c/0x64 [omap2])
[<bf0001a0>] (omap_nand_remove+0x0/0x64 [omap2]) from [<c02ca11c>] (platform_drv_remove+0x28/0x2c)
r5:bf001ca8 r4:c0673778
[<c02ca0f4>] (platform_drv_remove+0x0/0x2c) from [<c02c82c4>] (__device_release_driver+0x80/0xdc)
[<c02c8244>] (__device_release_driver+0x0/0xdc) from [<c02c8dd8>] (driver_detach+0xc4/0xc8)
r5:bf001ca8 r4:c0673778
[<c02c8d14>] (driver_detach+0x0/0xc8) from [<c02c804c>] (bus_remove_driver+0x9c/0x104)
r6:c0804ee0 r5:bf001ca8 r4:bf001ca8 r3:00000000
[<c02c7fb0>] (bus_remove_driver+0x0/0x104) from [<c02c950c>] (driver_unregister+0x60/0x80)
r6:c521e000 r5:bf001ca8 r4:00000000 r3:bf001924
[<c02c94ac>] (driver_unregister+0x0/0x80) from [<c02ca3a4>] (platform_driver_unregister+0x1c/0x20)
r5:00000000 r4:bf001d48
[<c02ca388>] (platform_driver_unregister+0x0/0x20) from [<bf001938>] (omap_nand_driver_exit+0x14/0x1c [omap2])
[<bf001924>] (omap_nand_driver_exit+0x0/0x1c [omap2]) from [<c009beb4>] (sys_delete_module+0x1f0/0x2ec)
[<c009bcc4>] (sys_delete_module+0x0/0x2ec) from [<c0014dc0>] (ret_fast_syscall+0x0/0x48)
r8:c0015028 r7:00000081 r6:b6fe0032 r5:70616d6f r4:0001a004
Code: e1a00005 eb0d9172 e7f001f2 e7f001f2 (e7f001f2)
---[ end trace 6a30b24d8c0cc2ee ]---
Segmentation fault
--->8---
This error was introduced in 67ce04bf2746f8a1f8c2a104b313d20c63f68378 which
was the first commit of this driver.
Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mtd/nand/omap2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1139,7 +1139,7 @@ static int omap_nand_remove(struct platf
/* Release NAND device, its internal structures and partitions */
nand_release(&info->mtd);
iounmap(info->nand.IO_ADDR_R);
- kfree(&info->mtd);
+ kfree(info);
return 0;
}
next prev parent reply other threads:[~2012-10-11 2:29 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 2:01 [ 00/84] 3.0.46-stable review Greg Kroah-Hartman
2012-10-11 2:02 ` [ 01/84] mn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it Greg Kroah-Hartman
2012-10-11 2:02 ` [ 02/84] kbuild: make: fix if_changed when command contains backslashes Greg Kroah-Hartman
2012-10-11 2:02 ` [ 03/84] media: rc: ite-cir: Initialise ite_dev::rdev earlier Greg Kroah-Hartman
2012-10-11 2:02 ` [ 04/84] ACPI: run _OSC after ACPI_FULL_INITIALIZATION Greg Kroah-Hartman
2012-10-11 2:02 ` [ 05/84] PCI: acpiphp: check whether _ADR evaluation succeeded Greg Kroah-Hartman
2012-10-11 2:02 ` [ 06/84] lib/gcd.c: prevent possible div by 0 Greg Kroah-Hartman
2012-10-11 2:02 ` [ 07/84] kernel/sys.c: call disable_nonboot_cpus() in kernel_restart() Greg Kroah-Hartman
2012-10-11 2:02 ` [ 08/84] drivers/scsi/atp870u.c: fix bad use of udelay Greg Kroah-Hartman
2012-10-11 2:02 ` [ 09/84] workqueue: add missing smp_wmb() in process_one_work() Greg Kroah-Hartman
2012-10-11 2:02 ` [ 10/84] xfrm: Workaround incompatibility of ESN and async crypto Greg Kroah-Hartman
2012-10-11 2:02 ` [ 11/84] xfrm_user: return error pointer instead of NULL Greg Kroah-Hartman
2012-10-11 2:02 ` [ 12/84] xfrm_user: return error pointer instead of NULL #2 Greg Kroah-Hartman
2012-10-11 2:02 ` [ 13/84] xfrm: fix a read lock imbalance in make_blackhole Greg Kroah-Hartman
2012-10-11 2:02 ` [ 14/84] xfrm_user: fix info leak in copy_to_user_auth() Greg Kroah-Hartman
2012-10-11 2:02 ` [ 15/84] xfrm_user: fix info leak in copy_to_user_state() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 16/84] xfrm_user: fix info leak in copy_to_user_policy() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 17/84] xfrm_user: fix info leak in copy_to_user_tmpl() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 18/84] xfrm_user: dont copy esn replay window twice for new states Greg Kroah-Hartman
2012-10-11 2:03 ` [ 19/84] xfrm_user: ensure user supplied esn replay window is valid Greg Kroah-Hartman
2012-10-11 2:03 ` [ 20/84] net: ethernet: davinci_cpdma: decrease the desc count when cleaning up the remaining packets Greg Kroah-Hartman
2012-10-11 2:03 ` [ 21/84] ixp4xx_hss: fix build failure due to missing linux/module.h inclusion Greg Kroah-Hartman
2012-10-11 2:03 ` [ 22/84] netxen: check for root bus in netxen_mask_aer_correctable Greg Kroah-Hartman
2012-10-11 2:03 ` [ 23/84] net-sched: sch_cbq: avoid infinite loop Greg Kroah-Hartman
2012-10-11 2:03 ` [ 24/84] pkt_sched: fix virtual-start-time update in QFQ Greg Kroah-Hartman
2012-10-11 2:03 ` [ 25/84] sierra_net: Endianess bug fix Greg Kroah-Hartman
2012-10-11 2:03 ` [ 26/84] 8021q: fix mac_len recomputation in vlan_untag() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 27/84] ipv6: release reference of ip6_null_entrys dst entry in __ip6_del_rt Greg Kroah-Hartman
2012-10-11 2:03 ` [ 28/84] tcp: flush DMA queue before sk_wait_data if rcv_wnd is zero Greg Kroah-Hartman
2012-10-11 2:03 ` [ 29/84] sctp: Dont charge for data in sndbuf again when transmitting packet Greg Kroah-Hartman
2012-10-11 2:03 ` [ 30/84] pppoe: drop PPPOX_ZOMBIEs in pppoe_release Greg Kroah-Hartman
2012-10-11 2:03 ` [ 31/84] net: small bug on rxhash calculation Greg Kroah-Hartman
2012-10-11 2:03 ` [ 32/84] net: guard tcp_set_keepalive() to tcp sockets Greg Kroah-Hartman
2012-10-11 2:03 ` [ 33/84] ipv4: raw: fix icmp_filter() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 34/84] ipv6: raw: fix icmpv6_filter() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 35/84] ipv6: mip6: fix mip6_mh_filter() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 36/84] l2tp: fix a typo in l2tp_eth_dev_recv() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 37/84] netrom: copy_datagram_iovec can fail Greg Kroah-Hartman
2012-10-11 2:03 ` [ 38/84] net: do not disable sg for packets requiring no checksum Greg Kroah-Hartman
2012-10-11 2:03 ` [ 39/84] aoe: assert AoE packets marked as " Greg Kroah-Hartman
2012-10-11 2:03 ` [ 40/84] tg3: Fix TSO CAP for 5704 devs w / ASF enabled Greg Kroah-Hartman
2012-10-11 2:03 ` [ 41/84] SCSI: zfcp: Make trace record tags unique Greg Kroah-Hartman
2012-10-11 2:03 ` [ 42/84] SCSI: zfcp: Do not wakeup while suspended Greg Kroah-Hartman
2012-10-11 2:03 ` [ 43/84] SCSI: zfcp: remove invalid reference to list iterator variable Greg Kroah-Hartman
2012-10-11 2:03 ` [ 44/84] SCSI: zfcp: restore refcount check on port_remove Greg Kroah-Hartman
2012-10-11 2:03 ` [ 45/84] SCSI: zfcp: only access zfcp_scsi_dev for valid scsi_device Greg Kroah-Hartman
2012-10-11 2:03 ` [ 46/84] PCI: Check P2P bridge for invalid secondary/subordinate range Greg Kroah-Hartman
2012-10-11 2:03 ` [ 47/84] ext4: online defrag is not supported for journaled files Greg Kroah-Hartman
2012-10-11 2:03 ` [ 48/84] ext4: always set i_op in ext4_mknod() Greg Kroah-Hartman
2012-10-11 2:03 ` [ 49/84] ext4: fix fdatasync() for files with only i_size changes Greg Kroah-Hartman
2012-10-11 2:03 ` [ 50/84] ASoC: wm9712: Fix name of Capture Switch Greg Kroah-Hartman
2012-10-11 2:03 ` [ 51/84] mm: fix invalidate_complete_page2() lock ordering Greg Kroah-Hartman
2012-10-11 2:03 ` [ 52/84] mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP Greg Kroah-Hartman
2012-10-11 2:03 ` [ 53/84] ALSA: aloop - add locking to timer access Greg Kroah-Hartman
2012-10-11 2:03 ` [ 54/84] ALSA: usb - disable broken hw volume for Tenx TP6911 Greg Kroah-Hartman
2012-10-11 2:03 ` [ 55/84] ALSA: USB: Support for (original) Xbox Communicator Greg Kroah-Hartman
2012-10-11 2:03 ` [ 56/84] drm/radeon: only adjust default clocks on NI GPUs Greg Kroah-Hartman
2012-10-11 2:03 ` [ 57/84] drm/radeon: Add MSI quirk for gateway RS690 Greg Kroah-Hartman
2012-10-11 2:03 ` [ 58/84] drm/radeon: force MSIs on RS690 asics Greg Kroah-Hartman
2012-10-11 2:03 ` [ 59/84] rcu: Fix day-one dyntick-idle stall-warning bug Greg Kroah-Hartman
2012-10-11 2:03 ` [ 60/84] r8169: fix wake on lan setting for non-8111E Greg Kroah-Hartman
2012-10-11 7:15 ` Jonathan Nieder
2012-10-11 10:59 ` Greg Kroah-Hartman
2012-10-11 2:03 ` [ 61/84] r8169: dont enable rx when shutdown Greg Kroah-Hartman
2012-10-11 2:03 ` [ 62/84] r8169: remove erroneous processing of always set bit Greg Kroah-Hartman
2012-10-11 2:03 ` [ 63/84] r8169: jumbo fixes Greg Kroah-Hartman
2012-10-11 2:03 ` [ 64/84] r8169: expand received packet length indication Greg Kroah-Hartman
2012-10-11 2:03 ` [ 65/84] r8169: increase the delay parameter of pm_schedule_suspend Greg Kroah-Hartman
2012-10-11 2:03 ` [ 66/84] r8169: Rx FIFO overflow fixes Greg Kroah-Hartman
2012-10-11 2:03 ` [ 67/84] r8169: fix Config2 MSIEnable bit setting Greg Kroah-Hartman
2012-10-11 2:03 ` [ 68/84] r8169: missing barriers Greg Kroah-Hartman
2012-10-11 2:03 ` [ 69/84] r8169: runtime resume before shutdown Greg Kroah-Hartman
2012-10-11 2:03 ` [ 70/84] r8169: Config1 is read-only on 8168c and later Greg Kroah-Hartman
2012-10-11 2:03 ` [ 71/84] r8169: 8168c and later require bit 0x20 to be set in Config2 for PME signaling Greg Kroah-Hartman
2012-10-11 2:03 ` [ 72/84] r8169: fix unsigned int wraparound with TSO Greg Kroah-Hartman
2012-10-11 2:03 ` [ 73/84] r8169: call netif_napi_del at errpaths and at driver unload Greg Kroah-Hartman
2012-10-11 2:03 ` [ 74/84] revert "mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkages" Greg Kroah-Hartman
2012-10-11 2:03 ` [ 75/84] mempolicy: remove mempolicy sharing Greg Kroah-Hartman
2012-10-11 2:04 ` [ 76/84] mempolicy: fix a race in shared_policy_replace() Greg Kroah-Hartman
2012-10-11 2:04 ` [ 77/84] mempolicy: fix refcount leak in mpol_set_shared_policy() Greg Kroah-Hartman
2012-10-11 2:04 ` [ 78/84] mempolicy: fix a memory corruption by refcount imbalance in alloc_pages_vma() Greg Kroah-Hartman
2012-10-11 2:04 ` [ 79/84] CPU hotplug, cpusets, suspend: Dont modify cpusets during suspend/resume Greg Kroah-Hartman
2012-10-11 2:04 ` [ 80/84] mtd: autcpu12-nvram: Fix compile breakage Greg Kroah-Hartman
2012-10-11 2:04 ` [ 81/84] mtd: nandsim: bugfix: fail if overridesize is too big Greg Kroah-Hartman
2012-10-11 2:04 ` [ 82/84] mtd: nand: Use the mirror BBT descriptor when reading its version Greg Kroah-Hartman
2012-10-11 2:04 ` Greg Kroah-Hartman [this message]
2012-10-11 2:04 ` [ 84/84] mtd: omap2: fix module loading Greg Kroah-Hartman
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=20121011015432.022856784@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=David.Woodhouse@intel.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andreas@biessmann.de \
--cc=artem.bityutskiy@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.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