if (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR) {
char buf[32];
- char *curptr = event->data.ext.ptr;
+ char __user *curptr = (char __user *)event->data.ext.ptr;
while (len > 0) {
int size = sizeof(buf);
if (len < size)
size = len;
- if (copy_from_user(buf, curptr, size) < 0)
+ if (copy_from_user(buf, curptr, size))
return -EFAULT;
err = func(private_data, buf, size);
if (err < 0)
return 0;
}
-static int seq_copy_in_user(char **bufptr, const void *src, int size)
+static int seq_copy_in_user(char __user **bufptr, const void *src, int size)
{
if (copy_to_user(*bufptr, src, size))
return -EFAULT;
if (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR) {
if (! in_kernel)
return -EINVAL;
- if (copy_from_user(buf, event->data.ext.ptr, len) < 0)
+ if (copy_from_user(buf, (void __user *)event->data.ext.ptr, len))
return -EFAULT;
return newlen;
}
/*
* allocate an event cell.
*/
-int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock, struct file *file)
+static int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock, struct file *file)
{
snd_seq_event_cell_t *cell;
unsigned long flags;
tmp->event = src->event;
src = src->next;
} else if (is_usrptr) {
- if (copy_from_user(&tmp->event, buf, size)) {
+ if (copy_from_user(&tmp->event, (char __user *)buf, size)) {
err = -EFAULT;
goto __error;
}
pool->total_elements = 0;
spin_unlock_irqrestore(&pool->lock, flags);
- if (ptr)
- vfree(ptr);
+ vfree(ptr);
spin_lock_irqsave(&pool->lock, flags);
pool->closing = 0;
pool_t *pool;
/* create pool block */
- pool = snd_kcalloc(sizeof(pool_t), GFP_KERNEL);
+ pool = kcalloc(1, sizeof(*pool), GFP_KERNEL);
if (pool == NULL) {
snd_printd("seq: malloc failed for pool\n");
return NULL;