Fix fops write, printk after copy from user

This commit is contained in:
Ciro Santilli
2017-05-23 08:47:30 +01:00
parent 960eca1008
commit 6c028f9398
2 changed files with 2 additions and 3 deletions

View File

@@ -69,7 +69,6 @@ static ssize_t fop_write(struct file *file, const char __user *buf, size_t len,
{
ssize_t ret;
printk(KERN_INFO "write\n");
printk(KERN_INFO "buf = %.*s\n", (int)len, buf);
printk(KERN_INFO "len = %zu\n", len);
printk(KERN_INFO "off = %lld\n", (long long)*off);
if (sizeof(data) <= *off) {
@@ -86,6 +85,7 @@ static ssize_t fop_write(struct file *file, const char __user *buf, size_t len,
}
}
}
printk(KERN_INFO "buf = %.*s\n", (int)len, data + *off);
printk(KERN_INFO "ret = %lld\n", (long long)ret);
return ret;
}