On 1/6/06, Alan Menegotto <[EMAIL PROTECTED]> wrote:
> Hi.
>
> I couldn't understand the logic in the function 'static int __init
> ipv4_proc_init(void)' located at net/ipv4/af_inet.c. Look at the code:
>
> static int __init ipv4_proc_init(void)
> {
>          int rc = 0;
>
>          if (raw_proc_init())
>                  goto out_raw;
>          if (tcp4_proc_init())
>                  goto out_tcp;
>          if (udp4_proc_init())
>                  goto out_udp;
>          if (fib_proc_init())
>                  goto out_fib;
>          if (ip_misc_proc_init())
>                  goto out_misc;
> out:
>          return rc;
> out_misc:
>          fib_proc_exit();
> out_fib:
>          udp4_proc_exit();
> out_udp:
>          tcp4_proc_exit();
> out_tcp:
>          raw_proc_exit();
> out_raw:
>          rc = -ENOMEM;
>          goto out;
> }
>
> Calling tcp4_proc_init should go to label out_tcp, which call
> raw_proc_exit(). Is this correct? If yes, why?

No, calling tcp4_proc_init() will only lead to calling raw_proc_exit()
if tcp4_proc_init() returns !0, i.e. if it fails.

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to