1
linux/arch/powerpc/sysdev
Liu Gang e80dd9a7bc arch/powerpc/sysdev/fsl_rio.c: release rapidio port I/O region resource if port failed to initialize
The "struct rio_mport" contains a member of master port I/O memory
resource structure "struct resource iores".  This resource will be read
from device tree and be used for rapidio R/W transaction memory space.
Rapidio requests the port I/O memory resource under the root resource
"iomem_resource".

			struct rio_mport *port;
			port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL);

			request_resource(&iomem_resource, &port->iores);

When port failed to initialize, allocated "rio_mport" structure memory
will be freed, and the port I/O memory resource structure pointer
"&port->iores" will be invalid.  If other requests resource under
"iomem_resource", "&port->iores" node may be operated in the child
resources list and this will cause the system to crash.

So the requested port I/O memory resource should be released before
freeing allocated "rio_mport" structure.

Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Acked-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-02 16:07:01 -07:00
..
bestcomm Fix common misspellings 2011-03-31 11:26:23 -03:00
qe_lib doc: fix broken references 2011-09-27 18:08:04 +02:00
xics Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-07-25 13:56:39 -07:00
6xx-suspend.S
axonram.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
cpm1.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
cpm2_pic.c powerpc/irq: Stop exporting irq_map 2011-05-04 15:02:15 +10:00
cpm2_pic.h
cpm2.c
cpm_common.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
dart_iommu.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
dart.h
dcr-low.S
dcr.c
ehv_pic.c powerpc: introduce the ePAPR embedded hypervisor vmpic driver 2011-06-27 08:30:26 -05:00
fsl_85xx_cache_ctlr.h
fsl_85xx_cache_sram.c powerpc: Remove ioremap_flags 2011-05-19 14:30:43 +10:00
fsl_85xx_l2ctlr.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2011-03-18 06:31:43 -07:00
fsl_gtm.c
fsl_lbc.c powerpc/85xx: fix race bug of calling request_irq after enable elbc interrupts 2011-06-03 00:09:09 -05:00
fsl_msi.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
fsl_msi.h
fsl_pci.c Merge branch 'next/cross-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-26 17:12:10 -07:00
fsl_pci.h powerpc/fsl_pci: Add support for FSL PCIe controllers v2.x 2011-03-15 09:29:56 -05:00
fsl_pmc.c dt/powerpc: Eliminate users of of_platform_{,un}register_driver 2011-02-28 01:36:39 -07:00
fsl_rio.c arch/powerpc/sysdev/fsl_rio.c: release rapidio port I/O region resource if port failed to initialize 2011-11-02 16:07:01 -07:00
fsl_soc.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
fsl_soc.h Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-3.x into fbdev-next 2011-08-29 09:14:30 +00:00
grackle.c powerpc: rename ppc_pci_*_flags to pci_*_flags 2011-07-12 09:28:04 -05:00
i8259.c powerpc: Remove i8259 irq_host_ops->unmap 2011-05-19 15:31:41 +10:00
indirect_pci.c Fix common misspellings 2011-03-31 11:26:23 -03:00
ipic.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
ipic.h
Kconfig powerpc/4xx: Adding PCIe MSI support 2011-05-26 15:00:37 +10:00
Makefile powerpc: introduce the ePAPR embedded hypervisor vmpic driver 2011-06-27 08:30:26 -05:00
micropatch.c
mmio_nvram.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
mpc5xxx_clocks.c
mpc8xx_pic.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
mpc8xx_pic.h
mpc8xxx_gpio.c powerpc/irq: Stop exporting irq_map 2011-05-04 15:02:15 +10:00
mpic_msi.c
mpic_pasemi_msi.c powerpc: Convert to new irq_* function names 2011-03-29 14:48:12 +02:00
mpic_u3msi.c powerpc: Convert to new irq_* function names 2011-03-29 14:48:12 +02:00
mpic.c Merge remote branch 'origin/master' into next 2011-06-30 15:23:59 +10:00
mpic.h powerpc: mpic irq_data conversion. 2011-03-10 11:03:56 +11:00
msi_bitmap.c
mv64x60_dev.c powerpc/mv64x60: Suspected typo in assignment 2011-03-02 16:50:05 +11:00
mv64x60_pci.c
mv64x60_pic.c powerpc/irq: Stop exporting irq_map 2011-05-04 15:02:15 +10:00
mv64x60_udbg.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
mv64x60.h
of_rtc.c
pmi.c dt/powerpc: Eliminate users of of_platform_{,un}register_driver 2011-02-28 01:36:39 -07:00
ppc4xx_cpm.c powerpc/4xx: Add suspend and idle support 2010-11-29 10:05:06 -05:00
ppc4xx_gpio.c
ppc4xx_msi.c powerpc/4xx: Adding PCIe MSI support 2011-05-26 15:00:37 +10:00
ppc4xx_pci.c powerpc/4xx: Fix build of PCI code on 405 2011-08-05 15:59:40 +10:00
ppc4xx_pci.h Fix common misspellings 2011-03-31 11:26:23 -03:00
ppc4xx_soc.c
rtc_cmos_setup.c
scom.c powerpc: Add SCOM infrastructure 2011-04-20 17:01:19 +10:00
simple_gpio.c
simple_gpio.h
tsi108_dev.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
tsi108_pci.c powerpc: Convert to new irq_* function names 2011-03-29 14:48:12 +02:00
uic.c locking, powerpc: Annotate uic->lock as raw 2011-09-13 11:12:10 +02:00
xilinx_intc.c powerpc/irq: Stop exporting irq_map 2011-05-04 15:02:15 +10:00
xilinx_pci.c