diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-04-29 15:56:11 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-05-05 08:20:58 +0200 |
commit | 71f150f4c2af5f1bc22c50f4d3d299fd7c177fd7 (patch) | |
tree | d462b596ef4226031bd4a73ec9ac8dfe24a692cf /net/core | |
parent | net: openvswitch: return an error instead of doing BUG_ON() (diff) | |
download | linux-71f150f4c2af5f1bc22c50f4d3d299fd7c177fd7.tar.xz linux-71f150f4c2af5f1bc22c50f4d3d299fd7c177fd7.zip |
bpf: Use PTR_ERR_OR_ZERO in bpf_fd_sk_storage_update_elem()
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/bpf_sk_storage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c index a8e9ac71b22d..cc9597a87770 100644 --- a/net/core/bpf_sk_storage.c +++ b/net/core/bpf_sk_storage.c @@ -708,7 +708,7 @@ static int bpf_fd_sk_storage_update_elem(struct bpf_map *map, void *key, if (sock) { sdata = sk_storage_update(sock->sk, map, value, map_flags); sockfd_put(sock); - return IS_ERR(sdata) ? PTR_ERR(sdata) : 0; + return PTR_ERR_OR_ZERO(sdata); } return err; |