int my_write(struct file *file, const char __user *ubuf, unsigned long count, void *data) { char buf[MAX_LENGTH]; //64 bytes int i; int ret = copy_from_user(&buf, ubuf, count); if (ret != 0) { printk(KERN_INFO "my_write: error copying data from userspace. ret=%d\n", ret); return -EFAULT; } return count; }