From ccd063e9812a2bdcbeafbbcd8dcb062bfc290f24 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 3 Apr 2019 09:12:48 +0200 Subject: watchdog: Move watchdog_dev to data section (BSS may not be cleared) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: Heiko Schocher Cc: Tom Rini Cc: Michal Simek Cc: "Marek BehĂșn" Cc: Daniel Schwierzeck Tested-by: Michal Simek (on zcu100) Reviewed-by: Michal Simek --- arch/mips/mach-mt7620/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/mips/mach-mt7620/cpu.c b/arch/mips/mach-mt7620/cpu.c index 9e0ca716f7..fe74f26a54 100644 --- a/arch/mips/mach-mt7620/cpu.c +++ b/arch/mips/mach-mt7620/cpu.c @@ -70,7 +70,7 @@ int print_cpuinfo(void) } #ifdef CONFIG_WATCHDOG -static struct udevice *watchdog_dev; +static struct udevice *watchdog_dev __attribute__((section(".data"))) = NULL; /* Called by macro WATCHDOG_RESET */ void watchdog_reset(void) -- cgit