diff --git a/20160425/chardev-1write.c b/20160425/chardev-1write.c index 9cd2373eb1c46a06ebf34dd6440634ad16ff24d5..57b540fb45953ec2e5ff91fb6006e393a2559c0e 100644 --- a/20160425/chardev-1write.c +++ b/20160425/chardev-1write.c @@ -193,7 +193,9 @@ 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 - msg_username[i] = buff[i]; //Heres the CRASH + get_user(msg_username[i], buff + i); + //msg_username[i] = buff[i]; //Heres the CRASH + //printk(KERN_INFO "Got %c at %d from %d bytes.\n", buff[i], i, (int)len); for(i = len; i < USERBUF_LEN; i++) //Zeroing the rest of mem msg_username[i] = 0; printk(KERN_INFO "%s: Successfully got %d bytes!\n",