Messages in this thread | | | Date | Tue, 17 Apr 2007 22:59:55 +0300 | From | "Török Edvin" <> | Subject | Re: SOLVED: Unable to add subdirectory: Ooops in sys_add_file, called from kobject_register |
| |
On 4/16/07, Török Edvin <edwintorok@gmail.com> wrote: > > I got an Ooops while trying to load a little kernel module I wrote. > [....] > /* Attributes changeable via sysfs */ > static struct attribute * default_attrs[] = { > &module_enabled.attr, > &wbinvd_execute.attr, > &algnment_checks.attr + , NULL > };
I was missing a NULL terminating entry here.
> > static struct kobject* control_kobject[NR_CPUS]; > [...] > control_kobject[cpu] = kzalloc(sizeof(control_kobject[0]), GFP_KERNEL);
I was missing a * here, so I ended up allocating fewer bytes. Correctly that line should read: + control_kobject[cpu] = kzalloc(sizeof(*control_kobject[0]), GFP_KERNEL);
Now the module works on Core Duo too. Posting this message to this list, just in case somebody else ends up doing the same mistakes I did.
Edwin - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |