mirror of
https://github.com/amazingfate/rtl8723ds.git
synced 2026-06-20 11:27:20 +01:00
rtl8723ds: Clean up some Coverity and Smatch warnings
The includes turning CONGIG_MP_INCLUDED off. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
@@ -621,6 +621,10 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter)
|
||||
WLAN_BSSID_EX *pnetwork = &(padapter->mlmeextpriv.mlmext_info.network);
|
||||
struct wlan_network *scanned = pmlmepriv->cur_network_scanned;
|
||||
|
||||
if (!scanned) {
|
||||
rtw_warn_on(1);
|
||||
return;
|
||||
}
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) {
|
||||
|
||||
_rtw_memcpy(&cur_network->network, pnetwork, sizeof(WLAN_BSSID_EX));
|
||||
@@ -634,17 +638,10 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter)
|
||||
return ;
|
||||
}
|
||||
} else {
|
||||
if (scanned == NULL)
|
||||
rtw_warn_on(1);
|
||||
|
||||
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
|
||||
) {
|
||||
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) {
|
||||
if (!rtw_cfg80211_inform_bss(padapter, scanned))
|
||||
RTW_INFO(FUNC_ADPT_FMT" inform fail !!\n", FUNC_ADPT_ARG(padapter));
|
||||
else {
|
||||
/* RTW_INFO(FUNC_ADPT_FMT" inform success !!\n", FUNC_ADPT_ARG(padapter)); */
|
||||
}
|
||||
} else {
|
||||
RTW_INFO("scanned & pnetwork compare fail\n");
|
||||
rtw_warn_on(1);
|
||||
@@ -1824,7 +1821,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
|
||||
#if defined(CONFIG_P2P) && ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE))
|
||||
case NL80211_IFTYPE_P2P_CLIENT:
|
||||
is_p2p = _TRUE;
|
||||
__attribute__((__fallthrough__));
|
||||
{__attribute__((__fallthrough__));}
|
||||
#endif
|
||||
case NL80211_IFTYPE_STATION:
|
||||
networkType = Ndis802_11Infrastructure;
|
||||
@@ -1849,7 +1846,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
|
||||
#if defined(CONFIG_P2P) && ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE))
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
is_p2p = _TRUE;
|
||||
__attribute__((__fallthrough__));
|
||||
{__attribute__((__fallthrough__));}
|
||||
#endif
|
||||
case NL80211_IFTYPE_AP:
|
||||
networkType = Ndis802_11APMode;
|
||||
@@ -2362,10 +2359,8 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if (pwdinfo->driver_interface == DRIVER_CFG80211) {
|
||||
if (ssids->ssid != NULL
|
||||
&& _rtw_memcmp(ssids->ssid, "DIRECT-", 7)
|
||||
&& rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)
|
||||
) {
|
||||
if (_rtw_memcmp(ssids->ssid, "DIRECT-", 7) &&
|
||||
rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)) {
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
rtw_p2p_enable(padapter, P2P_ROLE_DEVICE);
|
||||
else {
|
||||
@@ -2514,7 +2509,6 @@ check_need_indicate_scan_done:
|
||||
#endif
|
||||
}
|
||||
|
||||
cancel_ps_deny:
|
||||
if (ps_denied == _TRUE)
|
||||
rtw_ps_deny_cancel(padapter, PS_DENY_SCAN);
|
||||
|
||||
@@ -3644,6 +3638,8 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
|
||||
|
||||
if (skb)
|
||||
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
|
||||
else
|
||||
goto fail;
|
||||
|
||||
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
|
||||
goto fail;
|
||||
@@ -4283,9 +4279,9 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
exit:
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5716,7 +5712,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
|
||||
u32 dump_cnt = 0;
|
||||
bool ack = _TRUE;
|
||||
u8 tx_ch;
|
||||
u8 category, action;
|
||||
u8 category, action = 0;
|
||||
u8 frame_styp;
|
||||
int type = (-1);
|
||||
u32 start = rtw_get_current_time();
|
||||
@@ -7169,7 +7165,9 @@ int rtw_cfg80211_dev_res_alloc(struct dvobj_priv *dvobj)
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
||||
#if defined(RTW_SINGLE_WIPHY)
|
||||
exit:
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -7192,7 +7190,9 @@ int rtw_cfg80211_dev_res_register(struct dvobj_priv *dvobj)
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
||||
#if defined(RTW_SINGLE_WIPHY)
|
||||
exit:
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -2209,16 +2209,6 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
NDIS_802_11_AUTHENTICATION_MODE authmode;
|
||||
|
||||
/*
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->adapter_type > PRIMARY_IFACE)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_mi_buddy_check_fwstate(padapter, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == _TRUE) {
|
||||
RTW_INFO("set bssid, but buddy_intf is under scanning or linking\n");
|
||||
@@ -2301,7 +2291,9 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
||||
cancel_ps_deny:
|
||||
rtw_ps_deny_cancel(padapter, PS_DENY_JOIN);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
exit:
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5358,7 +5350,6 @@ static int rtw_p2p_connect(struct net_device *dev,
|
||||
#endif /* CONFIG_INTEL_WIDI */
|
||||
ret = -1;
|
||||
}
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5587,10 +5578,7 @@ static int rtw_p2p_set_persistent(struct net_device *dev,
|
||||
}
|
||||
printk("[%s] persistent_supported = %d\n", __FUNCTION__, pwdinfo->persistent_supported);
|
||||
|
||||
exit:
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int hexstr2bin(const char *hex, u8 *buf, size_t len)
|
||||
@@ -5776,10 +5764,7 @@ static int rtw_p2p_set_pc(struct net_device *dev,
|
||||
} else
|
||||
RTW_INFO("[%s] NOT Found in the Scanning Queue!\n", __FUNCTION__);
|
||||
|
||||
exit:
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int rtw_p2p_set_wfd_device_type(struct net_device *dev,
|
||||
@@ -5805,10 +5790,7 @@ static int rtw_p2p_set_wfd_device_type(struct net_device *dev,
|
||||
else /* Set to Miracast sink device. */
|
||||
pwfd_info->wfd_device_type = WFD_DEVINFO_PSINK;
|
||||
|
||||
exit:
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int rtw_p2p_set_wfd_enable(struct net_device *dev,
|
||||
@@ -5882,8 +5864,6 @@ static int rtw_p2p_set_sa(struct net_device *dev,
|
||||
}
|
||||
printk("[%s] session available = %d\n", __FUNCTION__, pwdinfo->session_available);
|
||||
|
||||
exit:
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
@@ -9586,8 +9566,11 @@ static int rtw_mp_efuse_set(struct net_device *dev,
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
pEfuseHal = &pHalData->EfuseHal;
|
||||
pHalFunc = &padapter->HalFunc;
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
pmp_priv = &padapter->mppriv;
|
||||
|
||||
#else
|
||||
pmp_priv = NULL;
|
||||
#endif
|
||||
err = 0;
|
||||
|
||||
if (copy_from_user(extra, wrqu->pointer, wrqu->length))
|
||||
@@ -10784,7 +10767,7 @@ static int rtw_priv_get(struct net_device *dev,
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_RTL8723B) || defined(CONFIG_SDIO_INDIRECT_ACCESS) || defined(CONFIG_APPEND_VENDOR_IE_ENABLE)
|
||||
switch (subcmd) {
|
||||
#if defined(CONFIG_RTL8723B)
|
||||
case MP_SetBT:
|
||||
@@ -10809,6 +10792,7 @@ static int rtw_priv_get(struct net_device *dev,
|
||||
default:
|
||||
return -EIO;
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_msleep_os(10); /* delay 5ms for sending pkt before exit adb shell operation */
|
||||
return 0;
|
||||
@@ -11510,8 +11494,8 @@ static int rtw_tdls_getsta(struct net_device *dev,
|
||||
}
|
||||
wrqu->data.length = strlen(extra);
|
||||
|
||||
#endif /* CONFIG_TDLS */
|
||||
exit:
|
||||
#endif /* CONFIG_TDLS */
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
@@ -4312,7 +4312,7 @@ int rtw_resume_common(_adapter *padapter)
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
|
||||
if (pwrpriv->bInSuspend == _FALSE)
|
||||
if (!pwrpriv || pwrpriv->bInSuspend == _FALSE)
|
||||
return 0;
|
||||
|
||||
RTW_PRINT("resume start\n");
|
||||
@@ -4334,12 +4334,10 @@ int rtw_resume_common(_adapter *padapter)
|
||||
#endif /* CONFIG_AP_WOWLAN */
|
||||
}
|
||||
|
||||
if (pwrpriv) {
|
||||
pwrpriv->bInSuspend = _FALSE;
|
||||
pwrpriv->bInSuspend = _FALSE;
|
||||
#ifdef CONFIG_WOWLAN
|
||||
pwrpriv->wowlan_in_resume = _FALSE;
|
||||
pwrpriv->wowlan_in_resume = _FALSE;
|
||||
#endif
|
||||
}
|
||||
RTW_PRINT("%s:%d in %d ms\n", __FUNCTION__ , ret,
|
||||
rtw_get_passing_time_ms(start_time));
|
||||
|
||||
|
||||
@@ -761,21 +761,11 @@ int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame)
|
||||
RTW_PRINT("recv eapol packet\n");
|
||||
|
||||
#ifdef CONFIG_AUTO_AP_MODE
|
||||
#if 1 /* for testing */
|
||||
#if 1
|
||||
if (0x8899 == pattrib->eth_type) {
|
||||
rtw_os_ksocket_send(padapter, precv_frame);
|
||||
|
||||
/* goto _recv_indicatepkt_drop; */
|
||||
}
|
||||
#else
|
||||
if (0x8899 == pattrib->eth_type) {
|
||||
rtw_auto_ap_mode_rx(padapter, precv_frame);
|
||||
|
||||
goto _recv_indicatepkt_end;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif /* CONFIG_AUTO_AP_MODE */
|
||||
|
||||
/* TODO: move to core */
|
||||
@@ -826,8 +816,6 @@ bypass_session_tracker:
|
||||
|
||||
rtw_os_recv_indicate_pkt(padapter, skb, pattrib);
|
||||
|
||||
_recv_indicatepkt_end:
|
||||
|
||||
precv_frame->u.hdr.pkt = NULL; /* pointers to NULL before rtw_free_recvframe() */
|
||||
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
@@ -899,10 +899,7 @@ ssize_t proc_set_macaddr_acl(struct file *file, const char __user *buffer, size_
|
||||
|
||||
c = strsep(&next, " \t");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exit:
|
||||
return count;
|
||||
}
|
||||
#endif /* CONFIG_RTW_MACADDR_ACL */
|
||||
|
||||
+14
-21
@@ -304,8 +304,6 @@ static u32 sdio_init(struct dvobj_priv *dvobj)
|
||||
release:
|
||||
sdio_release_host(func);
|
||||
|
||||
exit:
|
||||
|
||||
if (err)
|
||||
return _FAIL;
|
||||
return _SUCCESS;
|
||||
@@ -817,13 +815,8 @@ static int rtw_drv_init(
|
||||
rtw_signal_process(ui_pid[1], SIGUSR2);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
status = _SUCCESS;
|
||||
|
||||
os_ndevs_deinit:
|
||||
if (status != _SUCCESS)
|
||||
rtw_os_ndevs_deinit(dvobj);
|
||||
free_if_vir:
|
||||
if (status != _SUCCESS) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
@@ -914,7 +907,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
||||
int ret = 0;
|
||||
u8 ch, bw, offset;
|
||||
|
||||
if (psdpriv == NULL)
|
||||
if (!func || !psdpriv)
|
||||
goto exit;
|
||||
|
||||
if (psdpriv->processing_dev_remove == _TRUE) {
|
||||
@@ -946,20 +939,20 @@ exit:
|
||||
/* this is sprd's bug in Android 4.0, but sprd don't */
|
||||
/* want to fix it. */
|
||||
/* we have test power under 8723as, power consumption is ok */
|
||||
if (func) {
|
||||
mmc_pm_flag_t pm_flag = 0;
|
||||
pm_flag = sdio_get_host_pm_caps(func);
|
||||
RTW_INFO("cmd: %s: suspend: PM flag = 0x%x\n", sdio_func_id(func), pm_flag);
|
||||
if (!(pm_flag & MMC_PM_KEEP_POWER)) {
|
||||
RTW_INFO("%s: cannot remain alive while host is suspended\n", sdio_func_id(func));
|
||||
if (pdbgpriv)
|
||||
pdbgpriv->dbg_suspend_error_cnt++;
|
||||
return -ENOSYS;
|
||||
} else {
|
||||
RTW_INFO("cmd: suspend with MMC_PM_KEEP_POWER\n");
|
||||
sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
|
||||
}
|
||||
{
|
||||
unsigned pm_flag = 0;
|
||||
pm_flag = sdio_get_host_pm_caps(func);
|
||||
RTW_INFO("cmd: %s: suspend: PM flag = 0x%x\n", sdio_func_id(func), pm_flag);
|
||||
if (!(pm_flag & MMC_PM_KEEP_POWER)) {
|
||||
RTW_INFO("%s: cannot remain alive while host is suspended\n", sdio_func_id(func));
|
||||
if (pdbgpriv)
|
||||
pdbgpriv->dbg_suspend_error_cnt++;
|
||||
return -ENOSYS;
|
||||
} else {
|
||||
RTW_INFO("cmd: suspend with MMC_PM_KEEP_POWER\n");
|
||||
sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return ret;
|
||||
|
||||
@@ -904,9 +904,7 @@ void rtw_sleep_schedulable(int ms)
|
||||
delta = 1;/* 1 ms */
|
||||
}
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (schedule_timeout(delta) != 0)
|
||||
return ;
|
||||
return;
|
||||
schedule_timeout(delta);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user