From: Arnd Bergmann Date: Mon, 6 Nov 2017 13:55:35 +0000 (+0100) Subject: rtlwifi: fix uninitialized rtlhal->last_suspend_sec time X-Git-Tag: v5.15~9988^2~50^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f2a162fab15aee243178b5308bb5d1206fc4043;p=platform%2Fkernel%2Flinux-starfive.git rtlwifi: fix uninitialized rtlhal->last_suspend_sec time We set rtlhal->last_suspend_sec to an uninitialized stack variable, but unfortunately gcc never warned about this, I only found it while working on another patch. I opened a gcc bug for this. Presumably the value of rtlhal->last_suspend_sec is not all that important, but it does get used, so we probably want the patch backported to stable kernels. Cc: stable@vger.kernel.org Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82839 Signed-off-by: Arnd Bergmann Acked-by: Larry Finger Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c index aa69d10..52f17bd 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c @@ -1373,6 +1373,7 @@ static void _rtl8821ae_get_wakeup_reason(struct ieee80211_hw *hw) ppsc->wakeup_reason = 0; + do_gettimeofday(&ts); rtlhal->last_suspend_sec = ts.tv_sec; switch (fw_reason) {