summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2014-05-09 15:03:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-15 13:11:59 -0700
commit6e8bc71df6aeed8722256f5465b5857235c046a3 (patch)
treed573987d91e611a98d4fd0daed2c8f9bf4473d3b
parent2ad7c3d940015ec00b9772ff1f1f4f9a24b1f682 (diff)
downloadop-kernel-dev-6e8bc71df6aeed8722256f5465b5857235c046a3.zip
op-kernel-dev-6e8bc71df6aeed8722256f5465b5857235c046a3.tar.gz
staging: rtl8723au: Add GFP argument to rtw_alloc_stainfo23a()
No need to allocate GFP_ATOMIC when we don't need to. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8723au/core/rtw_ap.c4
-rw-r--r--drivers/staging/rtl8723au/core/rtw_cmd.c3
-rw-r--r--drivers/staging/rtl8723au/core/rtw_mlme.c6
-rw-r--r--drivers/staging/rtl8723au/core/rtw_mlme_ext.c2
-rw-r--r--drivers/staging/rtl8723au/core/rtw_sta_mgt.c7
-rw-r--r--drivers/staging/rtl8723au/include/sta_info.h2
6 files changed, 15 insertions, 9 deletions
diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
index 9cf91a7..01c6aed 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -1049,7 +1049,9 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,
/* alloc sta_info for ap itself */
psta = rtw_get_stainfo23a(&padapter->stapriv, pbss_network->MacAddress);
if (!psta) {
- psta = rtw_alloc_stainfo23a(&padapter->stapriv, pbss_network->MacAddress);
+ psta = rtw_alloc_stainfo23a(&padapter->stapriv,
+ pbss_network->MacAddress,
+ GFP_KERNEL);
if (!psta)
return _FAIL;
}
diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c b/drivers/staging/rtl8723au/core/rtw_cmd.c
index b94049f..a1f8ad9 100644
--- a/drivers/staging/rtl8723au/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723au/core/rtw_cmd.c
@@ -1510,7 +1510,8 @@ void rtw_createbss_cmd23a_callback(struct rtw_adapter *padapter,
pnetwork->MacAddress);
if (!psta) {
psta = rtw_alloc_stainfo23a(&padapter->stapriv,
- pnetwork->MacAddress);
+ pnetwork->MacAddress,
+ GFP_KERNEL);
if (!psta) {
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_,
("\nCan't alloc sta_info when "
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 8983862..13bfc2f 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -1014,7 +1014,8 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter,
psta = rtw_get_stainfo23a(pstapriv, pnetwork->network.MacAddress);
if (!psta)
psta = rtw_alloc_stainfo23a(pstapriv,
- pnetwork->network.MacAddress);
+ pnetwork->network.MacAddress,
+ GFP_ATOMIC);
if (psta) { /* update ptarget_sta */
DBG_8723A("%s\n", __func__);
@@ -1379,7 +1380,8 @@ void rtw_stassoc_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf)
return;
}
- psta = rtw_alloc_stainfo23a(&adapter->stapriv, pstassoc->macaddr);
+ psta = rtw_alloc_stainfo23a(&adapter->stapriv, pstassoc->macaddr,
+ GFP_KERNEL);
if (!psta) {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,
("Can't alloc sta_info when "
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index 5ac4113..7af99baa9 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -916,7 +916,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
/* allocate a new one */
DBG_8723A("going to alloc stainfo for sa ="MAC_FMT"\n",
MAC_ARG(sa));
- pstat = rtw_alloc_stainfo23a(pstapriv, sa);
+ pstat = rtw_alloc_stainfo23a(pstapriv, sa, GFP_ATOMIC);
if (!pstat) {
DBG_8723A(" Exceed the upper limit of supported "
"clients...\n");
diff --git a/drivers/staging/rtl8723au/core/rtw_sta_mgt.c b/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
index 317c10a..068ad35 100644
--- a/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
@@ -107,7 +107,8 @@ u32 _rtw_free_sta_priv23a(struct sta_priv *pstapriv)
return _SUCCESS;
}
-struct sta_info *rtw_alloc_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr)
+struct sta_info *
+rtw_alloc_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr, int gfp)
{
struct list_head *phash_list;
struct sta_info *psta;
@@ -116,7 +117,7 @@ struct sta_info *rtw_alloc_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr)
int i = 0;
u16 wRxSeqInitialValue = 0xffff;
- psta = (struct sta_info *)kmalloc(sizeof(struct sta_info), GFP_ATOMIC);
+ psta = (struct sta_info *)kmalloc(sizeof(struct sta_info), gfp);
if (!psta)
return NULL;
@@ -382,7 +383,7 @@ u32 rtw_init_bcmc_stainfo23a(struct rtw_adapter* padapter)
u32 res = _SUCCESS;
unsigned char bcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- psta = rtw_alloc_stainfo23a(pstapriv, bcast_addr);
+ psta = rtw_alloc_stainfo23a(pstapriv, bcast_addr, GFP_KERNEL);
if (psta == NULL) {
res = _FAIL;
RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_,
diff --git a/drivers/staging/rtl8723au/include/sta_info.h b/drivers/staging/rtl8723au/include/sta_info.h
index 27a604e..195a349 100644
--- a/drivers/staging/rtl8723au/include/sta_info.h
+++ b/drivers/staging/rtl8723au/include/sta_info.h
@@ -365,7 +365,7 @@ static inline u32 wifi_mac_hash(const u8 *mac)
u32 _rtw_init_sta_priv23a(struct sta_priv *pstapriv);
u32 _rtw_free_sta_priv23a(struct sta_priv *pstapriv);
-struct sta_info *rtw_alloc_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr);
+struct sta_info *rtw_alloc_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr, int gfp);
u32 rtw_free_stainfo23a(struct rtw_adapter *padapter, struct sta_info *psta);
void rtw_free_all_stainfo23a(struct rtw_adapter *padapter);
struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, const u8 *hwaddr);
OpenPOWER on IntegriCloud