diff options
| author | Aditya Pakki <pakki001@umn.edu> | 2018-12-24 11:30:17 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-12-27 19:18:03 -0500 |
| commit | f0fb9b288d0a7e9cc324ae362e2dfd2cc2217ded (patch) | |
| tree | d81f5dc4f0712579670180ecc6f370271a8d7d30 /net | |
| parent | dc4501ff287547dea7ca10f1c580c741291a8760 (diff) | |
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: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
| -rw-r--r-- | net/ipv6/route.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 194bc162866d..a94e0b02a8ac 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -5054,12 +5054,16 @@ int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write, | |||
| 5054 | { | 5054 | { |
| 5055 | struct net *net; | 5055 | struct net *net; |
| 5056 | int delay; | 5056 | int delay; |
| 5057 | int ret; | ||
| 5057 | if (!write) | 5058 | if (!write) |
| 5058 | return -EINVAL; | 5059 | return -EINVAL; |
| 5059 | 5060 | ||
| 5060 | net = (struct net *)ctl->extra1; | 5061 | net = (struct net *)ctl->extra1; |
| 5061 | delay = net->ipv6.sysctl.flush_delay; | 5062 | delay = net->ipv6.sysctl.flush_delay; |
| 5062 | proc_dointvec(ctl, write, buffer, lenp, ppos); | 5063 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); |
| 5064 | if (ret) | ||
| 5065 | return ret; | ||
| 5066 | |||
| 5063 | fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0); | 5067 | fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0); |
| 5064 | return 0; | 5068 | return 0; |
| 5065 | } | 5069 | } |
