Messages in this thread Patch in this message | | | Date | Fri, 1 Apr 2022 07:33:03 +0800 | From | kernel test robot <> | Subject | [PATCH] net: fix err_cast.cocci warnings |
| |
From: kernel test robot <lkp@intel.com>
net/socket.c:1571:9-16: WARNING: ERR_CAST can be used with sock
Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
Generated by: scripts/coccinelle/api/err_cast.cocci
Fixes: 3af464ccde38 ("net: add __sys_socket_file()") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: kernel test robot <lkp@intel.com> ---
tree: https://github.com/ammarfaizi2/linux-block axboe/linux-block/sock-nolock head: 8698873371093e22f708c2cf3a31f4dc2caab84f commit: 3af464ccde389a5df95af3e221d098ac34d4606f [7/9] net: add __sys_socket_file() :::::: branch date: 4 hours ago :::::: commit date: 4 hours ago
net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/socket.c +++ b/net/socket.c @@ -1568,7 +1568,7 @@ struct file *__sys_socket_direct(int fam sock = __sys_socket_create(family, type, protocol); if (IS_ERR(sock)) - return ERR_PTR(PTR_ERR(sock)); + return ERR_CAST(sock); flags = type & ~SOCK_TYPE_MASK; if (SOCK_NONBLOCK != O_NONBLOCK && (flags & SOCK_NONBLOCK))
| |