static long snd_alloc_vmalloc;
static LIST_HEAD(snd_alloc_kmalloc_list);
static LIST_HEAD(snd_alloc_vmalloc_list);
-static DEFINE_SPINLOCK(snd_alloc_kmalloc_lock);
-static DEFINE_SPINLOCK(snd_alloc_vmalloc_lock);
+static spinlock_t snd_alloc_kmalloc_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t snd_alloc_vmalloc_lock = SPIN_LOCK_UNLOCKED;
#define KMALLOC_MAGIC 0x87654321
#define VMALLOC_MAGIC 0x87654320
static snd_info_entry_t *snd_memory_info_entry;
}
}
-static void *__snd_kmalloc(size_t size, int flags, void *caller)
+void *__snd_kmalloc(size_t size, int flags, void *caller)
{
unsigned long cpu_flags;
struct snd_alloc_track *t;
{
unsigned long flags;
struct snd_alloc_track *t;
- if (obj == NULL)
+ if (obj == NULL) {
+ snd_printk(KERN_WARNING "null kfree (called from %p)\n", __builtin_return_address(0));
return;
+ }
t = snd_alloc_track_entry(obj);
if (t->magic != KMALLOC_MAGIC) {
snd_printk(KERN_WARNING "bad kfree (called from %p)\n", __builtin_return_address(0));
void snd_hidden_vfree(void *obj)
{
struct snd_alloc_track *t;
- if (obj == NULL)
+ if (obj == NULL) {
+ snd_printk(KERN_WARNING "null vfree (called from %p)\n", __builtin_return_address(0));
return;
+ }
t = snd_alloc_track_entry(obj);
if (t->magic != VMALLOC_MAGIC) {
snd_printk(KERN_ERR "bad vfree (called from %p)\n", __builtin_return_address(0));
size_t c = count;
if (c > sizeof(buf))
c = sizeof(buf);
- memcpy_fromio(buf, (void __iomem *)src, c);
+ memcpy_fromio(buf, src, c);
if (copy_to_user(dst, buf, c))
return -EFAULT;
count -= c;