mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: SOLVED: Unable to add subdirectory: Ooops in sys_add_file, called from kobject_register
@ 2007-04-17 19:59 Török Edvin
  0 siblings, 0 replies; only message in thread
From: Török Edvin @ 2007-04-17 19:59 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-17 19:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-17 19:59 SOLVED: Unable to add subdirectory: Ooops in sys_add_file, called from kobject_register Török Edvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®