summaryrefslogtreecommitdiff
path: root/board/xilinx/microblaze-generic/microblaze-generic.c
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2019-04-03 09:12:48 +0200
committerChristoph Müllner <christophm30@gmail.com>2019-04-26 00:52:31 +0200
commit39be8f2c91a863f15ba15de8252d9c2193c51fb2 (patch)
tree3aa26119f289517fddfc0387279e400938b384d1 /board/xilinx/microblaze-generic/microblaze-generic.c
parent72c9af85b58d0b5926457e2885536228aacbd229 (diff)
watchdog: Move watchdog_dev to data section (BSS may not be cleared)
This patch moves all instances of static "watchdog_dev" declarations to the "data" section. This may be needed, as the BSS may not be cleared in the early U-Boot phase, where watchdog_reset() is already beeing called. This may result in incorrect pointer access, as the check to "!watchdog_dev" in watchdog_reset() may not be true and the function may continue to run. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: "Marek Behún" <marek.behun@nic.cz> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Michal Simek <michal.simek@xilinx.com> (on zcu100) Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'board/xilinx/microblaze-generic/microblaze-generic.c')
-rw-r--r--board/xilinx/microblaze-generic/microblaze-generic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c
index c946ec3208..28c9efa3a2 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -25,7 +25,7 @@
DECLARE_GLOBAL_DATA_PTR;
#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT)
-static struct udevice *watchdog_dev;
+static struct udevice *watchdog_dev __attribute__((section(".data"))) = NULL;
#endif /* !CONFIG_SPL_BUILD && CONFIG_WDT */
ulong ram_base;