Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71f150f4 authored by YueHaibing's avatar YueHaibing Committed by Alexei Starovoitov
Browse files

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: default avatarYueHaibing <yuehaibing@huawei.com>
Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent a734d1f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;