Fixed crash when debug flag is set

This commit is contained in:
kimocoder 2019-11-13 17:24:08 +01:00
parent b9f88289b2
commit 02e8c82c9b
2 changed files with 10 additions and 28 deletions

View File

@ -1419,6 +1419,7 @@ static u8 is_rtw_ndev(struct net_device *ndev)
static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state, void *ptr)
{
struct net_device *ndev;
_adapter *adapter;
if (ptr == NULL)
return NOTIFY_DONE;
@ -1432,6 +1433,8 @@ static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state
if (ndev == NULL)
return NOTIFY_DONE;
adapter = rtw_netdev_priv(ndev);
if (!is_rtw_ndev(ndev))
return NOTIFY_DONE;
@ -1959,7 +1962,6 @@ u32 rtw_start_drv_threads(_adapter *padapter)
}
}
#ifdef CONFIG_EVENT_THREAD_MODE
if (padapter->evtThread == NULL) {
RTW_INFO(FUNC_ADPT_FMT " start RTW_EVENT_THREAD\n", FUNC_ADPT_ARG(padapter));
@ -2060,7 +2062,6 @@ u8 rtw_init_default_value(_adapter *padapter)
rtw_init_registrypriv_dev_network(padapter);
rtw_update_registrypriv_dev_network(padapter);
/* hal_priv */
rtw_hal_def_value_init(padapter);
@ -2509,8 +2510,6 @@ u8 rtw_init_drv_sw(_adapter *padapter)
exit:
return ret8;
}
@ -2870,7 +2869,6 @@ _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter,
padapter->hw_port = HW_PORT1;
#endif
/****** hook vir if into dvobj ******/
pdvobjpriv = adapter_to_dvobj(padapter);
padapter->iface_id = pdvobjpriv->iface_nums;
@ -2888,7 +2886,6 @@ _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter,
if (rtw_init_drv_sw(padapter) != _SUCCESS)
goto free_drv_sw;
/*get mac address from primary_padapter*/
_rtw_memcpy(mac, adapter_mac_addr(primary_padapter), ETH_ALEN);
@ -2983,7 +2980,6 @@ void rtw_drv_free_vir_if(_adapter *padapter)
rtw_vmfree((u8 *)padapter, sizeof(_adapter));
}
void rtw_drv_stop_vir_ifaces(struct dvobj_priv *dvobj)
{
int i;
@ -3000,7 +2996,6 @@ void rtw_drv_free_vir_ifaces(struct dvobj_priv *dvobj)
rtw_drv_free_vir_if(dvobj->padapters[i]);
}
#endif /*end of CONFIG_CONCURRENT_MODE*/
/* IPv4, IPv6 IP addr notifier */
@ -3378,14 +3373,12 @@ int _netdev_open(struct net_device *pnetdev)
netdev_br_init(pnetdev);
#endif /* CONFIG_BR_EXT */
padapter->bup = _TRUE;
padapter->net_closed = _FALSE;
padapter->netif_up = _TRUE;
pwrctrlpriv->bips_processing = _FALSE;
}
netdev_open_normal_process:
RTW_INFO(FUNC_NDEV_FMT" Success (bup=%d)\n", FUNC_NDEV_ARG(pnetdev), padapter->bup);
return 0;
@ -3589,7 +3582,6 @@ int netdev_open(struct net_device *pnetdev)
#endif
_exit_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL);
#ifdef CONFIG_AUTO_AP_MODE
if (padapter->iface_id == IFACE_ID2)
rtw_start_auto_ap(padapter);
@ -3608,7 +3600,6 @@ int ips_netdrv_open(_adapter *padapter)
RTW_INFO("===> %s.........\n", __FUNCTION__);
rtw_clr_drv_stopped(padapter);
/* padapter->bup = _TRUE; */
#ifdef CONFIG_NEW_NETDEV_HDL
@ -3695,7 +3686,6 @@ void rtw_ips_dev_unload(_adapter *padapter)
#endif /* defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) */
RTW_INFO("====> %s...\n", __FUNCTION__);
#if defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS)
#ifdef DBG_CONFIG_ERROR_DETECT
if (psrtpriv->silent_reset_inprogress == _TRUE)
@ -3763,7 +3753,6 @@ int _pm_netdev_open(_adapter *padapter)
pwrctrlpriv->bips_processing = _FALSE;
}
netdev_open_normal_process:
RTW_INFO(FUNC_NDEV_FMT" Success (bup=%d)\n", FUNC_NDEV_ARG(pnetdev), padapter->bup);
return 0;
@ -4396,7 +4385,6 @@ int rtw_suspend_wow(_adapter *padapter)
RTW_INFO("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter));
RTW_INFO("wowlan_mode: %d\n", pwrpriv->wowlan_mode);
RTW_INFO("wowlan_pno_enable: %d\n", pwrpriv->wowlan_pno_enable);
#ifdef CONFIG_P2P_WOWLAN
@ -4614,7 +4602,6 @@ int rtw_suspend_ap_wow(_adapter *padapter)
}
#endif /* #ifdef CONFIG_AP_WOWLAN */
int rtw_suspend_normal(_adapter *padapter)
{
int ret = _SUCCESS;
@ -4634,7 +4621,6 @@ int rtw_suspend_normal(_adapter *padapter)
|| (adapter_to_pwrctl(padapter)->rf_pwrstate == rf_off))
RTW_PRINT("%s: ### ERROR #### driver in IPS ####ERROR###!!!\n", __FUNCTION__);
#ifdef CONFIG_CONCURRENT_MODE
rtw_set_drv_stopped(padapter); /*for stop thread*/
rtw_stop_cmd_thread(padapter);
@ -4727,7 +4713,6 @@ int rtw_suspend_common(_adapter *padapter)
#endif /*CONFIG_AP_WOWLAN*/
}
RTW_PRINT("rtw suspend success in %d ms\n",
rtw_get_passing_time_ms(start_time));
@ -4814,7 +4799,6 @@ int rtw_resume_process_wow(_adapter *padapter)
if (psta)
set_sta_rate(padapter, psta);
rtw_clr_drv_stopped(padapter);
RTW_INFO("%s: wowmode resuming, DriverStopped:%s\n", __func__, rtw_is_drv_stopped(padapter) ? "True" : "False");
@ -4925,7 +4909,6 @@ int rtw_resume_process_ap_wow(_adapter *padapter)
goto exit;
}
#ifdef CONFIG_LPS
if (!(pwrpriv->wowlan_dis_lps)) {
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "AP-WOWLAN");
@ -5163,7 +5146,6 @@ int rtw_resume_common(_adapter *padapter)
RTW_PRINT("%s:%d in %d ms\n", __FUNCTION__ , ret,
rtw_get_passing_time_ms(start_time));
return ret;
}