rtl8188eu: Fix "fix some UBSAN and kmalloc warnings"

This fixes
commit 4a73c76f02
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Mon May 10 10:25:47 2021 -0500

    rtl8188eu: fix some UBSAN and kmalloc warnings

For LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0).

The function argument 'upd' only exists, if
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0),
hence move the 'if' block reading 'upd' inside the
'#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))' macro guard.
This commit is contained in:
Karsten Wiese 2021-12-11 17:03:43 +01:00
parent c708301cca
commit 0f6d12e144

View file

@ -4419,11 +4419,11 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
u16 frame_type;
bool reg = false;
#endif
if (upd->global_stypes < 11)
frame_type = (u16)BIT(upd->global_stypes << 4);
else
frame_type = 0;
#endif
#ifdef CONFIG_DEBUG_CFG80211
DBG_88E(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
frame_type, reg);