From 0f6d12e144d6a4d56f6a782dbc50f816db0b35fa Mon Sep 17 00:00:00 2001 From: Karsten Wiese Date: Sat, 11 Dec 2021 17:03:43 +0100 Subject: [PATCH] rtl8188eu: Fix "fix some UBSAN and kmalloc warnings" This fixes commit 4a73c76f02d01ea47ea749d055c01d6f55bc36ac Author: Larry Finger 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. --- os_dep/ioctl_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os_dep/ioctl_cfg80211.c b/os_dep/ioctl_cfg80211.c index 6ea8adf..5944b20 100644 --- a/os_dep/ioctl_cfg80211.c +++ b/os_dep/ioctl_cfg80211.c @@ -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);