]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: shmobile: lager: do not annotate gpio_buttons as __initdata
authorSimon Horman <horms+renesas@verge.net.au>
Fri, 26 Jul 2013 08:53:42 +0000 (17:53 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Wed, 31 Jul 2013 01:11:17 +0000 (10:11 +0900)
commit13def637423d3763561e14428e2b474e31a7db24
treef81f38cfb2351352bb9bbdffe01b61c468e86be2
parent7ba1975f99580babfe7ec6d299155a8146e9dda3
ARM: shmobile: lager: do not annotate gpio_buttons as __initdata

When the gpio-keys device is registered using
platform_device_register_data() the platform data argument,
lager_keys_pdata is duplicated and thus should be marked as __initdata
to avoid wasting memory. However, this is not true of gpio_buttons,
a reference to it rather than its value is duplicated when lager_keys_pdata
is duplicated.

This avoids accessing freed memory if gpio-key events occur
after unused kernel memory is freed late in the kernel's boot.

This but was added when support for gpio-keys was added to lager
in fd1702d3f8b948614f3822c456c54369a63a9399
("ARM: shmobile: lager: support GPIO switches") which was included
in v3.11-rc1.

Tested-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/board-lager.c