public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* value of returning positive error code from module_init()?
@ 2009-07-04 16:38 Robert P. J. Day
  2009-07-04 18:01 ` Robert Hancock
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2009-07-04 16:38 UTC (permalink / raw)
  To: Linux Kernel Mailing List


  whoops, i forgot to ask this as well.  accidentally, i returned a
positive value from a module_init() routine, which loaded the module
and generated in /var/log/messages:

...
Jul  4 12:34:43 localhost kernel: hi module being loaded.
Jul  4 12:34:43 localhost kernel: sys_init_module: 'hi'->init
suspiciously returned 42, it should follow 0/-E convention
Jul  4 12:34:43 localhost kernel: sys_init_module: loading module
anyway...
Jul  4 12:34:43 localhost kernel: Pid: 3881, comm: insmod Tainted: G
M       2.6.29.5-191.fc11.x86_64 #1
Jul  4 12:34:43 localhost kernel: Call Trace:
Jul  4 12:34:43 localhost kernel: [<ffffffff8106f33b>]
sys_init_module+0x13e/0x1cd
Jul  4 12:34:43 localhost kernel: [<ffffffff8101133a>]
system_call_fastpath+0x16
...

  i'd never seen that before, i guess because i never returned a
positive error code.  is there a tradition for returning positive
values?  for what purpose?  thanks.

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Linked In:                             http://www.linkedin.com/in/rpjday
Twitter:                                       http://twitter.com/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: value of returning positive error code from module_init()?
  2009-07-04 16:38 value of returning positive error code from module_init()? Robert P. J. Day
@ 2009-07-04 18:01 ` Robert Hancock
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Hancock @ 2009-07-04 18:01 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

On 07/04/2009 10:38 AM, Robert P. J. Day wrote:
>    whoops, i forgot to ask this as well.  accidentally, i returned a
> positive value from a module_init() routine, which loaded the module
> and generated in /var/log/messages:
>
> ...
> Jul  4 12:34:43 localhost kernel: hi module being loaded.
> Jul  4 12:34:43 localhost kernel: sys_init_module: 'hi'->init
> suspiciously returned 42, it should follow 0/-E convention
> Jul  4 12:34:43 localhost kernel: sys_init_module: loading module
> anyway...
> Jul  4 12:34:43 localhost kernel: Pid: 3881, comm: insmod Tainted: G
> M       2.6.29.5-191.fc11.x86_64 #1
> Jul  4 12:34:43 localhost kernel: Call Trace:
> Jul  4 12:34:43 localhost kernel: [<ffffffff8106f33b>]
> sys_init_module+0x13e/0x1cd
> Jul  4 12:34:43 localhost kernel: [<ffffffff8101133a>]
> system_call_fastpath+0x16
> ...
>
>    i'd never seen that before, i guess because i never returned a
> positive error code.  is there a tradition for returning positive
> values?  for what purpose?  thanks.

My guess would be no, hence the warning you're not supposed to do it..

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-04 18:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-04 16:38 value of returning positive error code from module_init()? Robert P. J. Day
2009-07-04 18:01 ` Robert Hancock

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