From 6926fe7f636ce229dc8d2b03eecddea07c163539 Mon Sep 17 00:00:00 2001 From: Christian kimocoder Date: Tue, 24 Oct 2017 14:32:15 +0200 Subject: [PATCH] Some fixes and tweaks --- os_dep/linux/ioctl_cfg80211.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index b86f26d..759b38d 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -648,8 +648,10 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter) return ; } } else { - if (scanned == NULL) + if (scanned == NULL) { rtw_warn_on(1); + return; + } if (_rtw_memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID)) == _TRUE && _rtw_memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) == _TRUE @@ -907,7 +909,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { if (param->u.crypt.idx >= WEP_KEYS #ifdef CONFIG_IEEE80211W - && param->u.crypt.idx > BIP_MAX_KEYID + || param->u.crypt.idx >= BIP_MAX_KEYID #endif /* CONFIG_IEEE80211W */ ) { ret = -EINVAL; @@ -1166,7 +1168,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { if (param->u.crypt.idx >= WEP_KEYS #ifdef CONFIG_IEEE80211W - && param->u.crypt.idx > BIP_MAX_KEYID + || param->u.crypt.idx >= BIP_MAX_KEYID #endif /* CONFIG_IEEE80211W */ ) { ret = -EINVAL; @@ -3478,8 +3480,10 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - if (skb) - rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize); + if (!skb) + goto fail; + + rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize); if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header))) goto fail;