Commit ea40b324 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

[IPV4]: Make __devinet_sysctl_register return an error

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: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8afd351c
...@@ -1454,8 +1454,8 @@ static struct devinet_sysctl_table { ...@@ -1454,8 +1454,8 @@ static struct devinet_sysctl_table {
}, },
}; };
static void __devinet_sysctl_register(char *dev_name, int ctl_name, static int __devinet_sysctl_register(struct net *net, char *dev_name,
struct ipv4_devconf *p) int ctl_name, struct ipv4_devconf *p)
{ {
int i; int i;
struct devinet_sysctl_table *t; struct devinet_sysctl_table *t;
...@@ -1497,14 +1497,14 @@ static void __devinet_sysctl_register(char *dev_name, int ctl_name, ...@@ -1497,14 +1497,14 @@ static void __devinet_sysctl_register(char *dev_name, int ctl_name,
goto free_procname; goto free_procname;
p->sysctl = t; p->sysctl = t;
return; return 0;
free_procname: free_procname:
kfree(t->dev_name); kfree(t->dev_name);
free: free:
kfree(t); kfree(t);
out: out:
return; return -ENOBUFS;
} }
static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf) static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment