| Index: crypto/kernel/alloc.c
|
| diff --git a/srtp/crypto/kernel/alloc.c b/crypto/kernel/alloc.c
|
| similarity index 78%
|
| rename from srtp/crypto/kernel/alloc.c
|
| rename to crypto/kernel/alloc.c
|
| index e728798c8101efe6acae553fe05abf09ce20358d..d82353070dc352d65415ef705b86fdd7728096a7 100644
|
| --- a/srtp/crypto/kernel/alloc.c
|
| +++ b/crypto/kernel/alloc.c
|
| @@ -51,52 +51,23 @@
|
|
|
| /* the debug module for memory allocation */
|
|
|
| -debug_module_t mod_alloc = {
|
| +srtp_debug_module_t mod_alloc = {
|
| 0, /* debugging is off by default */
|
| "alloc" /* printable name for module */
|
| };
|
|
|
| /*
|
| - * Nota bene: the debugging statements for crypto_alloc() and
|
| - * crypto_free() have identical prefixes, which include the addresses
|
| + * Nota bene: the debugging statements for srtp_crypto_alloc() and
|
| + * srtp_crypto_free() have identical prefixes, which include the addresses
|
| * of the memory locations on which they are operating. This fact can
|
| * be used to locate memory leaks, by turning on memory debugging,
|
| * grepping for 'alloc', then matching alloc and free calls by
|
| * address.
|
| */
|
|
|
| -#ifdef SRTP_KERNEL_LINUX
|
| +#if defined(HAVE_STDLIB_H)
|
|
|
| -#include <linux/interrupt.h>
|
| -
|
| -void *
|
| -crypto_alloc(size_t size) {
|
| - void *ptr;
|
| -
|
| - ptr = kmalloc(size, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
|
| -
|
| - if (ptr) {
|
| - debug_print(mod_alloc, "(location: %p) allocated", ptr);
|
| - } else {
|
| - debug_print(mod_alloc, "allocation failed (asked for %d bytes)\n", size);
|
| - }
|
| -
|
| - return ptr;
|
| -}
|
| -
|
| -void
|
| -crypto_free(void *ptr) {
|
| -
|
| - debug_print(mod_alloc, "(location: %p) freed", ptr);
|
| -
|
| - kfree(ptr);
|
| -}
|
| -
|
| -
|
| -#elif defined(HAVE_STDLIB_H)
|
| -
|
| -void *
|
| -crypto_alloc(size_t size) {
|
| +void * srtp_crypto_alloc(size_t size) {
|
| void *ptr;
|
|
|
| ptr = malloc(size);
|
| @@ -110,8 +81,7 @@ crypto_alloc(size_t size) {
|
| return ptr;
|
| }
|
|
|
| -void
|
| -crypto_free(void *ptr) {
|
| +void srtp_crypto_free(void *ptr) {
|
|
|
| debug_print(mod_alloc, "(location: %p) freed", ptr);
|
|
|
|
|