Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9fa896429905eccc263ff0d5e592ecaf651af12d
Commit:     9fa896429905eccc263ff0d5e592ecaf651af12d
Parent:     c3bac5a71b24f6ed892b250d4f7511cedc33d34c
Author:     Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Sun Dec 2 00:17:46 2007 +1100
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:55:25 2008 -0800

    [IPV4]: Cleanup the devinet_sysctl_register
    
    I moved the call to kmalloc() from the *t declaration into
    the code (this is confusing when a variable is initialized
    with the result of some call) and removed unneeded comment
    near the error path. Just like I did with the neigh ctl-s.
    
    Besides, I fixed the goto's and the labels - they were indented
    with spaces :(
    
    Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/devinet.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 6e75c88..72dd0ec 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1506,12 +1506,13 @@ static void devinet_sysctl_register(struct in_device 
*in_dev,
 {
        int i;
        struct net_device *dev = in_dev ? in_dev->dev : NULL;
-       struct devinet_sysctl_table *t = kmemdup(&devinet_sysctl, sizeof(*t),
-                                                GFP_KERNEL);
+       struct devinet_sysctl_table *t;
        char *dev_name = NULL;
 
+       t = kmemdup(&devinet_sysctl, sizeof(*t), GFP_KERNEL);
        if (!t)
-               return;
+               goto out;
+
        for (i = 0; i < ARRAY_SIZE(t->devinet_vars) - 1; i++) {
                t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf;
                t->devinet_vars[i].extra1 = p;
@@ -1532,7 +1533,7 @@ static void devinet_sysctl_register(struct in_device 
*in_dev,
         */
        dev_name = kstrdup(dev_name, GFP_KERNEL);
        if (!dev_name)
-           goto free;
+               goto free;
 
        t->devinet_dev[0].procname    = dev_name;
        t->devinet_dev[0].child       = t->devinet_vars;
@@ -1542,16 +1543,16 @@ static void devinet_sysctl_register(struct in_device 
*in_dev,
 
        t->sysctl_header = register_sysctl_table(t->devinet_root_dir);
        if (!t->sysctl_header)
-           goto free_procname;
+               goto free_procname;
 
        p->sysctl = t;
        return;
 
-       /* error path */
- free_procname:
+free_procname:
        kfree(dev_name);
- free:
+free:
        kfree(t);
+out:
        return;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to