- if (from_user) {
- temp_buffer = kmalloc (count, GFP_KERNEL);
- if (temp_buffer == NULL) {
- err ("%s - out of memory.", __FUNCTION__);
- retval = -ENOMEM;
- goto exit;
- }
- if (copy_from_user (temp_buffer, (void __user *)buf, count)) {
- retval = -EFAULT;
- goto exit;
- }
- current_buffer = temp_buffer;
- } else {
- current_buffer = buf;
- }