提交 f0fb9b28 编写于 作者: A Aditya Pakki 提交者: David S. Miller

ipv6/route: Add a missing check on proc_dointvec

While flushing the cache via  ipv6_sysctl_rtcache_flush(), the call
to proc_dointvec() may fail. The fix adds a check that returns the
error, on failure.
Signed-off-by: NAditya Pakki <pakki001@umn.edu>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 dc4501ff
...@@ -5054,12 +5054,16 @@ int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write, ...@@ -5054,12 +5054,16 @@ int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write,
{ {
struct net *net; struct net *net;
int delay; int delay;
int ret;
if (!write) if (!write)
return -EINVAL; return -EINVAL;
net = (struct net *)ctl->extra1; net = (struct net *)ctl->extra1;
delay = net->ipv6.sysctl.flush_delay; delay = net->ipv6.sysctl.flush_delay;
proc_dointvec(ctl, write, buffer, lenp, ppos); ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
if (ret)
return ret;
fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0); fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册