RTC/watchdog: M41T80: fix a potential use of unitialized data

Watchdog handlers within the driver make use of "save_client" -- make sure it
has been initalized before the handlers are registered.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexander Bigga <ab@mycable.de>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Maciej W. Rozycki and committed by Linus Torvalds 417607d0 6c82c415

+1 -1
+1 -1
drivers/rtc/rtc-m41t80.c
··· 803 804 #ifdef CONFIG_RTC_DRV_M41T80_WDT 805 if (clientdata->features & M41T80_FEATURE_HT) { 806 rc = misc_register(&wdt_dev); 807 if (rc) 808 goto exit; ··· 812 misc_deregister(&wdt_dev); 813 goto exit; 814 } 815 - save_client = client; 816 } 817 #endif 818 return 0;
··· 803 804 #ifdef CONFIG_RTC_DRV_M41T80_WDT 805 if (clientdata->features & M41T80_FEATURE_HT) { 806 + save_client = client; 807 rc = misc_register(&wdt_dev); 808 if (rc) 809 goto exit; ··· 811 misc_deregister(&wdt_dev); 812 goto exit; 813 } 814 } 815 #endif 816 return 0;