]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtlwifi: fix uninitialized rtlhal->last_suspend_sec time
authorArnd Bergmann <arnd@arndb.de>
Mon, 6 Nov 2017 13:55:35 +0000 (14:55 +0100)
committerSasha Levin <alexander.levin@microsoft.com>
Fri, 18 May 2018 03:26:45 +0000 (23:26 -0400)
[ Upstream commit 3f2a162fab15aee243178b5308bb5d1206fc4043 ]

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 <arnd@arndb.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/net/wireless/rtlwifi/rtl8821ae/hw.c

index 76e52dfb2be5dff3278132f2c5cf6a6638324d3f..cf0e54b8846cc50213c461135a9a1ce7c27251ae 100644 (file)
@@ -1377,6 +1377,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) {