From: "Török Edvin" <edwintorok@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: SOLVED: Unable to add subdirectory: Ooops in sys_add_file, called from kobject_register
Date: Tue, 17 Apr 2007 22:59:55 +0300 [thread overview]
Message-ID: <4354d3270704171259w6110f678ldfec7da3f264d111@mail.gmail.com> (raw)
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
reply other threads:[~2007-04-17 19:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4354d3270704171259w6110f678ldfec7da3f264d111@mail.gmail.com \
--to=edwintorok@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®