diff --git a/20160425/chardev-1write.c b/20160425/chardev-1write.c index f592326f1b07a613483363e6bbed20aafecc79ee..71a07510c0dfb610dcded0baf00ffa20408a2b00 100644 --- a/20160425/chardev-1write.c +++ b/20160425/chardev-1write.c @@ -192,8 +192,8 @@ device_write(struct file *filp, const char *buff, size_t len, loff_t * off) } else { int i; - for(i = 0; i < len; i++) {//Save the given string - if(get_user(msg_username[i], buff + i) < 0) { //If returning error code + for(i = 0; i < len; i++) {//Save the given string + if(get_user(msg_username[i], buff + i) < 0) { //If returning error code printk(KERN_WARNING "%s: You want to play a trick on me! This memory does not belong to you!\n", DEVICE_NAME); return -EFAULT; //Stop reading from userspace.