static ssize_t id_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{
char *buffer;
buffer = kcalloc(cnt, sizeof(char), GFP_KERNEL);
if (buffer) {
if (copy_from_user(buffer, buf, cnt) == cnt) {
if (strcmp(buffer, "Tanure") == 0)
return cnt;
}
}
}
return -EINVAL;
}
The copy_from_user returns 6 when I write my name in the file. So, 6 means that copy_from_user fails to copy 6 bytes from buf.
So there is my question, buf is a user pointer ? Or Can I just copy without problems ?
All this e-mails got me in trouble here. I got kicked from eudyptula challenge, what I still begging to be able to finish.
Thanks Greg for all the help.