Skip to content

Commit

Permalink
[IPV4]: Make __devinet_sysctl_register return an error
Browse files Browse the repository at this point in the history
Currently, this function is void, so failures in creating
sysctls for new/renamed devices are not reported to anywhere.

Fixing this is another complex (needed?) task, but this
return value is needed during the namespaces creation to
handle the case, when we failed to create "all" and "default"
entries.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jan 28, 2008
1 parent 8afd351 commit ea40b32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,8 +1454,8 @@ static struct devinet_sysctl_table {
},
};

static void __devinet_sysctl_register(char *dev_name, int ctl_name,
struct ipv4_devconf *p)
static int __devinet_sysctl_register(struct net *net, char *dev_name,
int ctl_name, struct ipv4_devconf *p)
{
int i;
struct devinet_sysctl_table *t;
Expand Down Expand Up @@ -1497,14 +1497,14 @@ static void __devinet_sysctl_register(char *dev_name, int ctl_name,
goto free_procname;

p->sysctl = t;
return;
return 0;

free_procname:
kfree(t->dev_name);
free:
kfree(t);
out:
return;
return -ENOBUFS;
}

static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
Expand Down

0 comments on commit ea40b32

Please sign in to comment.