Re: Module parameters and __initdata

From: Rusty Russell
Date: Sun Jan 16 2011 - 18:20:09 EST


On Thu, 6 Jan 2011 08:46:59 am Alan Stern wrote:
> Is the proper use of "__initdata" with module parameters documented
> anywhere?
>
> I'm running into problems with drivers/usb/gadget/printer.c, which
> includes code such as this:
>
>
> static ushort __initdata bcdDevice;
> module_param(bcdDevice, ushort, S_IRUGO);
> MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");

You need to make perm 0. You can't read it if it's freed after init!

Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/