diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-11-06 21:39:50 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2020-11-06 21:56:18 +0100 |
commit | d435c05ab0197ee302290e1cee3f2d9c9024a64f (patch) | |
tree | 73f3f92c1aaaf5be72d4083299f584eafdf69b5a /net/sunrpc/sysctl.c | |
parent | NFSD: fix missing refcount in nfsd4_copy by nfsd4_do_async_copy (diff) | |
download | linux-d435c05ab0197ee302290e1cee3f2d9c9024a64f.tar.xz linux-d435c05ab0197ee302290e1cee3f2d9c9024a64f.zip |
net/sunrpc: return 0 on attempt to write to "transports"
You can't write to this file because the permissions are 0444. But
it sort of looked like you could do a write and it would result in
a read. Then it looked like proc_sys_call_handler() just ignored
it. Which is confusing. It's more clear if the "write" just
returns zero.
Also, the "lenp" pointer is never NULL so that check can be removed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/sysctl.c')
-rw-r--r-- | net/sunrpc/sysctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index a18b36b5422d..5c9f5bca4d99 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c @@ -65,7 +65,7 @@ static int proc_do_xprt(struct ctl_table *table, int write, char tmpbuf[256]; size_t len; - if ((*ppos && !write) || !*lenp) { + if (write || *ppos) { *lenp = 0; return 0; } |