Thomas Petazzoni wrote:
Hi,
Le Thu, 6 Jul 2006 17:01:45 +0200,
"Fernando Apesteguía" <fernando.apesteguia@xxxxxxxxx> a écrit :
*entry = create_proc_entry(name, mode, parent);
if (entry == NULL) {
This test is incorrect now.
From which version?
from 2.6.16, fs/proc/generic.c: create_proc_entry(),
...
ent = proc_create(&parent,name,mode,nlink);
if (ent) {
if (S_ISDIR(mode)) {
ent->proc_fops = &proc_dir_operations;
ent->proc_iops = &proc_dir_inode_operations;
}
if (proc_register(parent, ent) < 0) {
kfree(ent);
ent = NULL;
}
}
return ent;
}
return value can be NULL.
Just checked 2.6.18-rc1, the code is same.
Regards,
Om
--
This is PLEASANT!
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/