Skip to content

Commit

Permalink
net/sunrpc: return 0 on attempt to write to "transports"
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
Dan Carpenter authored and J. Bruce Fields committed Nov 6, 2020
1 parent 49a3613 commit d435c05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d435c05

Please sign in to comment.