Skip to content

Commit

Permalink
bpf: Use PTR_ERR_OR_ZERO in bpf_fd_sk_storage_update_elem()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YueHaibing authored and Alexei Starovoitov committed May 5, 2019
1 parent a734d1f commit 71f150f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/bpf_sk_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 71f150f

Please sign in to comment.