aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/netprio_cgroup.c
diff options
context:
space:
mode:
authorFlorent Revest <revest@chromium.org>2020-12-04 12:36:04 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2020-12-04 22:32:40 +0100
commitdba4a9256bb4d78ef89aaad5f49787aa27fcd5b4 (patch)
tree21572e1bceac8fd13f1c8a190b65316c8c1e8a66 /net/core/netprio_cgroup.c
parentMerge branch 'Improve error handling of verifier tests' (diff)
downloadlinux-dev-dba4a9256bb4d78ef89aaad5f49787aa27fcd5b4.tar.xz
linux-dev-dba4a9256bb4d78ef89aaad5f49787aa27fcd5b4.zip
net: Remove the err argument from sock_from_file
Currently, the sock_from_file prototype takes an "err" pointer that is either not set or set to -ENOTSOCK IFF the returned socket is NULL. This makes the error redundant and it is ignored by a few callers. This patch simplifies the API by letting callers deduce the error based on whether the returned socket is NULL or not. Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Florent Revest <revest@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: KP Singh <kpsingh@google.com> Link: https://lore.kernel.org/bpf/20201204113609.1850150-1-revest@google.com
Diffstat (limited to 'net/core/netprio_cgroup.c')
-rw-r--r--net/core/netprio_cgroup.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index 9bd4cab7d510..99a431c56f23 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -220,8 +220,7 @@ static ssize_t write_priomap(struct kernfs_open_file *of,
static int update_netprio(const void *v, struct file *file, unsigned n)
{
- int err;
- struct socket *sock = sock_from_file(file, &err);
+ struct socket *sock = sock_from_file(file);
if (sock) {
spin_lock(&cgroup_sk_update_lock);
sock_cgroup_set_prioidx(&sock->sk->sk_cgrp_data,