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)
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, event->data.ext.ptr, len))
return -EFAULT;
return newlen;
}
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;