diff options
| author | Florent Revest <[email protected]> | 2020-12-04 12:36:04 +0100 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2020-12-04 22:32:40 +0100 |
| commit | dba4a9256bb4d78ef89aaad5f49787aa27fcd5b4 (patch) | |
| tree | 21572e1bceac8fd13f1c8a190b65316c8c1e8a66 /include | |
| parent | 5c667dca71095abec90420eb09503f35f66c9585 (diff) | |
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 <[email protected]>
Signed-off-by: Florent Revest <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: KP Singh <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/net.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index 0dcd51feef02..9e2324efc26a 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -240,7 +240,7 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg); int sock_recvmsg(struct socket *sock, struct msghdr *msg, int flags); struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname); struct socket *sockfd_lookup(int fd, int *err); -struct socket *sock_from_file(struct file *file, int *err); +struct socket *sock_from_file(struct file *file); #define sockfd_put(sock) fput(sock->file) int net_ratelimit(void); |
