diff mbox series

net/sunrpc: Fix return value for sysctl sunrpc.transports

Message ID 635CFB46-6C1B-4C7A-9BD6-7B26E6AD022F@gmail.com
State New
Headers show
Series net/sunrpc: Fix return value for sysctl sunrpc.transports | expand

Commit Message

Artur Molchanov Oct. 11, 2020, 7:28 p.m. UTC
Fix returning value for sysctl sunrpc.transports.

Without this fix sysctl returns random garbage for this sysctl key.

Signed-off-by: Artur Molchanov <arturmolchanov@gmail.com>
Cc: stable@vger.kernel.org
---
 net/sunrpc/sysctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Artur Molchanov Oct. 11, 2020, 7:34 p.m. UTC | #1
Add maintainers.


Artur Molchanov

> 11 окт. 2020 г., в 22:28, Artur Molchanov <arturmolchanov@gmail.com> написал(а):
> 
> Fix returning value for sysctl sunrpc.transports.
> 
> Without this fix sysctl returns random garbage for this sysctl key.
> 
> Signed-off-by: Artur Molchanov <arturmolchanov@gmail.com>
> Cc: stable@vger.kernel.org
> ---
> net/sunrpc/sysctl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
> index 999eee1ed61c..1edcecef23dc 100644
> --- a/net/sunrpc/sysctl.c
> +++ b/net/sunrpc/sysctl.c
> @@ -70,7 +70,8 @@ static int proc_do_xprt(struct ctl_table *table, int write,
> 		return 0;
> 	}
> 	len = svc_print_xprts(tmpbuf, sizeof(tmpbuf));
> -	return memory_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
> +	*lenp = memory_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
> +	return 0;
> }
> 
> static int
> -- 
> 2.20.1
> 
>
diff mbox series

Patch

diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 999eee1ed61c..1edcecef23dc 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -70,7 +70,8 @@  static int proc_do_xprt(struct ctl_table *table, int write,
 		return 0;
 	}
 	len = svc_print_xprts(tmpbuf, sizeof(tmpbuf));
-	return memory_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
+	*lenp = memory_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
+	return 0;
 }
 
 static int