linux/drivers/of
Paul Burton de96ec2a77 OF: Prevent unaligned access in of_alias_scan()
When allocating a struct alias_prop, of_alias_scan() only requested that
it be aligned on a 4 byte boundary. The struct contains pointers which
leads to us attempting 64 bit writes on 64 bit systems, and if the CPU
doesn't support unaligned memory accesses then this causes problems -
for example on some MIPS64r2 CPUs including the "mips64r2-generic" QEMU
emulated CPU it will trigger an address error exception.

Fix this by requesting alignment for the struct alias_prop allocation
matching that which the compiler expects, using the __alignof__ keyword.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14306/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2017-01-03 16:34:48 +01:00
..
unittest-data
Kconfig mtd: Kill the OF_MTD Kconfig option 2016-09-23 09:35:16 +02:00
Makefile MTD updates for v4.7: 2016-05-24 11:00:20 -07:00
address.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
base.c OF: Prevent unaligned access in of_alias_scan() 2017-01-03 16:34:48 +01:00
device.c iommu: of: enforce const-ness of struct iommu_ops 2016-05-09 15:33:29 +02:00
dynamic.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
fdt.c of: Add check to of_scan_flat_dt() before accessing initial_boot_params 2017-01-03 16:34:43 +01:00
fdt_address.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
irq.c of: irq: make of_msi_configure accessible from modules 2016-10-19 19:02:58 +05:30
of_mdio.c of_mdio: add helper to deregister fixed-link PHYs 2016-11-29 23:17:02 -05:00
of_net.c
of_numa.c of, numa: Return NUMA_NO_NODE from disable of_node_to_nid() if nid not possible. 2016-11-15 09:17:12 -06:00
of_pci.c of/pci: Add of_pci_get_max_link_speed() to parse max-link-speed from DT 2016-11-14 15:21:14 -06:00
of_pci_irq.c of_pci_irq: Silence bogus "of_irq_parse_pci() failed ..." messages. 2015-09-17 14:46:11 -05:00
of_private.h of: fix memory leak related to safe_name() 2016-06-24 15:16:10 -05:00
of_reserved_mem.c DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
overlay.c of/overlay: add of overlay notifications 2016-11-10 17:03:35 +01:00
pdt.c
platform.c of/platform: clarify of_find_device_by_node refcounting 2016-11-15 09:17:19 -06:00
resolver.c of: Fix issue where code would fall through to error case. 2016-12-09 10:33:03 -06:00
unittest.c of: unittest: use of_platform_default_populate() to populate default bus 2016-06-23 15:00:59 -05:00