From: Jes Sorensen Date: Fri, 9 May 2014 13:03:46 +0000 (+0200) Subject: staging: rtl8723au: add GFP argument to rtw_alloc_network() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ec838b0bc92630021eb32910b6ea3c3fc5da9e06;p=linux-beck.git staging: rtl8723au: add GFP argument to rtw_alloc_network() This allows us to use GFP_KERNEL when calling from a work handler. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c b/drivers/staging/rtl8723au/core/rtw_cmd.c index dc61a816e39b..b94049fa96d8 100644 --- a/drivers/staging/rtl8723au/core/rtw_cmd.c +++ b/drivers/staging/rtl8723au/core/rtw_cmd.c @@ -1523,7 +1523,7 @@ void rtw_createbss_cmd23a_callback(struct rtw_adapter *padapter, rtw_indicate_connect23a(padapter); spin_unlock_bh(&pmlmepriv->lock); } else { - pwlan = rtw_alloc_network(pmlmepriv); + pwlan = rtw_alloc_network(pmlmepriv, GFP_KERNEL); spin_lock_bh(&pmlmepriv->scanned_queue.lock); if (!pwlan) { pwlan = rtw_get_oldest_wlan_network23a(&pmlmepriv->scanned_queue); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index ddbe6c648225..8983862d44f2 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -127,11 +127,11 @@ void rtw_free_mlme_priv23a(struct mlme_priv *pmlmepriv) rtw23a_free_mlme_priv_ie_data(pmlmepriv); } -struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv) +struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv, int gfp) { struct wlan_network *pnetwork; - pnetwork = kzalloc(sizeof(struct wlan_network), GFP_ATOMIC); + pnetwork = kzalloc(sizeof(struct wlan_network), gfp); if (pnetwork) { INIT_LIST_HEAD(&pnetwork->list); pnetwork->network_type = 0; @@ -514,7 +514,7 @@ void rtw_update_scanned_network23a(struct rtw_adapter *adapter, /* If we didn't find a match, then get a new network slot to initialize * with this beacon's information */ if (!found) { - pnetwork = rtw_alloc_network(pmlmepriv); + pnetwork = rtw_alloc_network(pmlmepriv, GFP_ATOMIC); if (!pnetwork) { if (!oldest) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index 6dd8fb476553..2b72d5bd4d28 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -454,7 +454,7 @@ void rtw23a_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv); void _rtw_free_mlme_priv23a(struct mlme_priv *pmlmepriv); -struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv); +struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv, int gfp); int rtw_if_up23a(struct rtw_adapter *padapter);