aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/csr/unifi_sme.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 16:41:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 16:41:09 -0700
commit786eeeb3756e7fb08174c3a136c16462ccd541d1 (patch)
tree9b7621b4448768f8f950e80a1bba468652608f1c /drivers/staging/csr/unifi_sme.c
parent55a27055b9ea5aabf8206ed6b7777c79f4e840c3 (diff)
staging: csr: remove CsrPmemAlloc
It's just a wrapper around kmalloc(, GFP_KERNEL) + a call to panic() if we are out of memory, which is a very foolish thing to do (the panic that is.) So replace it with calls to kmalloc() and ignore the out-of-memory casese for now, odds are it will not be hit, and if it does, hey, we will end up panicing just the same as with the old code. Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com> Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com> Cc: Riku Mettälä <riku.mettala@bluegiga.com> Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/csr/unifi_sme.c')
-rw-r--r--drivers/staging/csr/unifi_sme.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/csr/unifi_sme.c b/drivers/staging/csr/unifi_sme.c
index 0cb7b0145ed..ff639d47d07 100644
--- a/drivers/staging/csr/unifi_sme.c
+++ b/drivers/staging/csr/unifi_sme.c
@@ -411,7 +411,7 @@ uf_multicast_list_wq(struct work_struct *work)
* Allocate a new list, need to free it later
* in unifi_mgt_multicast_address_cfm().
*/
- multicast_address_list = CsrPmemAlloc(mc_count * sizeof(CsrWifiMacAddress));
+ multicast_address_list = kmalloc(mc_count * sizeof(CsrWifiMacAddress), GFP_KERNEL);
if (multicast_address_list == NULL) {
return;
@@ -590,7 +590,7 @@ int unifi_cfg_packet_filters(unifi_priv_t *priv, unsigned char *arg)
priv->packet_filters.tclas_ies_length += sizeof(tclas_t);
}
if (priv->packet_filters.tclas_ies_length > 0) {
- priv->filter_tclas_ies = CsrPmemAlloc(priv->packet_filters.tclas_ies_length);
+ priv->filter_tclas_ies = kmalloc(priv->packet_filters.tclas_ies_length, GFP_KERNEL);
if (priv->filter_tclas_ies == NULL) {
return -ENOMEM;
}
@@ -671,7 +671,7 @@ int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg)
unifi_trace(priv, UDBG4, "addts: tid = 0x%x ie_length = %d\n",
addts_tid, addts_ie_length);
- addts_ie = CsrPmemAlloc(addts_ie_length);
+ addts_ie = kmalloc(addts_ie_length, GFP_KERNEL);
if (addts_ie == NULL) {
unifi_error(priv,
"unifi_cfg_wmm_addts: Failed to malloc %d bytes for addts_ie buffer\n",
@@ -1209,7 +1209,7 @@ void uf_send_pkt_to_encrypt(struct work_struct *work)
pktBulkDataLength = interfacePriv->wapi_unicast_bulk_data.data_length;
if (pktBulkDataLength > 0) {
- pktBulkData = (u8 *)CsrPmemAlloc(pktBulkDataLength);
+ pktBulkData = kmalloc(pktBulkDataLength, GFP_KERNEL);
memset(pktBulkData, 0, pktBulkDataLength);
} else {
unifi_error(priv, "uf_send_pkt_to_encrypt() : invalid buffer\n");