diff options
author | Christoph Jaeger | 2014-08-08 08:01:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-08-16 21:23:12 +0200 |
commit | 50222db4b03ac8f3259c6d39bbd585ed3358f70f (patch) | |
tree | 65e60815c6b1fb86a29ce36cbe908c2588df1507 /drivers/staging/ozwpan/ozproto.c | |
parent | staging: ozwpan: Use slab cache for oz_elt_info allocation (diff) | |
download | kernel-qcow2-linux-50222db4b03ac8f3259c6d39bbd585ed3358f70f.tar.gz kernel-qcow2-linux-50222db4b03ac8f3259c6d39bbd585ed3358f70f.tar.xz kernel-qcow2-linux-50222db4b03ac8f3259c6d39bbd585ed3358f70f.zip |
staging: ozwpan: Use slab cache for oz_tx_frame allocation
Use a slab cache rather than rolling our own free list.
Signed-off-by: Christoph Jaeger <email@christophjaeger.info>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ozwpan/ozproto.c')
-rw-r--r-- | drivers/staging/ozwpan/ozproto.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c index b592e96a8445..db6ef99e9dc4 100644 --- a/drivers/staging/ozwpan/ozproto.c +++ b/drivers/staging/ozwpan/ozproto.c @@ -53,6 +53,7 @@ static u16 g_apps = 0x1; static int g_processing_rx; struct kmem_cache *oz_elt_info_cache; +struct kmem_cache *oz_tx_frame_cache; /* * Context: softirq-serialized @@ -483,6 +484,7 @@ void oz_protocol_term(void) spin_unlock_bh(&g_polling_lock); oz_dbg(ON, "Protocol stopped\n"); + kmem_cache_destroy(oz_tx_frame_cache); kmem_cache_destroy(oz_elt_info_cache); } @@ -771,6 +773,12 @@ int oz_protocol_init(char *devs) if (!oz_elt_info_cache) return -ENOMEM; + oz_tx_frame_cache = KMEM_CACHE(oz_tx_frame, 0); + if (!oz_tx_frame_cache) { + kmem_cache_destroy(oz_elt_info_cache); + return -ENOMEM; + } + skb_queue_head_init(&g_rx_queue); if (devs[0] == '*') { oz_binding_add(NULL); |