aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/csr/csr_wifi_hip_dump.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 15:37:12 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 15:37:12 -0700
commit70128792b7802efcf485e9b62249cf8a639187d8 (patch)
tree22453e906c9796628b84256944786db506450cf3 /drivers/staging/csr/csr_wifi_hip_dump.c
parent4fe9db37104f833972486355fe86d7dcd29279b5 (diff)
staging: csr: remove CsrMemAlloc()
It's just calling kmalloc(, GFP_KERNEL), so call that instead. A few places should be calling kzalloc(), so do that, and remove the call to memset at the same time. 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/csr_wifi_hip_dump.c')
-rw-r--r--drivers/staging/csr/csr_wifi_hip_dump.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/csr/csr_wifi_hip_dump.c b/drivers/staging/csr/csr_wifi_hip_dump.c
index 350d9d20448..d67b460e7a8 100644
--- a/drivers/staging/csr/csr_wifi_hip_dump.c
+++ b/drivers/staging/csr/csr_wifi_hip_dump.c
@@ -667,24 +667,19 @@ coredump_buffer* new_coredump_node(void *ospriv, coredump_buffer *prevnode)
u32 zone_size;
/* Allocate node header */
- newnode = (coredump_buffer *)CsrMemAlloc(sizeof(coredump_buffer));
+ newnode = kzalloc(sizeof(coredump_buffer), GFP_KERNEL);
if (newnode == NULL)
{
return NULL;
}
- memset(newnode, 0, sizeof(coredump_buffer));
/* Allocate chip memory zone capture buffers */
for (i = 0; i < HIP_CDUMP_NUM_ZONES; i++)
{
zone_size = sizeof(u16) * zonedef_table[i].length;
- newzone = (u16 *)CsrMemAlloc(zone_size);
+ newzone = kzalloc(zone_size, GFP_KERNEL);
newnode->zone[i] = newzone;
- if (newzone != NULL)
- {
- memset(newzone, 0, zone_size);
- }
- else
+ if (newzone == NULL)
{
unifi_error(ospriv, "Out of memory on coredump zone %d (%d words)\n",
i, zonedef_table[i].length);