- /* Additional copy to avoid copy_from_user() under spinlock.
- * We tradeoff this extra copy to allow to pack more the
- * IrCOMM frames. This is advantageous because the IrDA link
- * is the bottleneck. */
- if (from_user) {
- kbuf = kmalloc(count, GFP_KERNEL);
- if (kbuf == NULL)
- return -ENOMEM;
- if (copy_from_user(kbuf, ubuf, count)) {
- kfree(kbuf);
- return -EFAULT;
- }
- } else
- /* The buffer is already in kernel space */
- kbuf = (unsigned char *) ubuf;
-