lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4354d3270704171259w6110f678ldfec7da3f264d111@mail.gmail.com>
Date:	Tue, 17 Apr 2007 22:59:55 +0300
From:	"Török Edvin" <edwintorok@...il.com>
To:	linux-kernel@...r.kernel.org
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@...il.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ