Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0fb9b28 authored by Aditya Pakki's avatar Aditya Pakki Committed by David S. Miller
Browse files

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: default avatarAditya Pakki <pakki001@umn.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dc4501ff
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -5054,12 +5054,16 @@ int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write,
{
	struct net *net;
	int delay;
	int ret;
	if (!write)
		return -EINVAL;

	net = (struct net *)ctl->extra1;
	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);
	return 0;
}