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

Commit 0584c47b authored by Kamal Heib's avatar Kamal Heib Committed by Jason Gunthorpe
Browse files

RDMA/core: Check for verbs callbacks before using them



Make sure the providers implement the verbs callbacks before calling
them, otherwise return -EOPNOTSUPP.

Signed-off-by: default avatarKamal Heib <kamalheib1@gmail.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 7150c3d5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2504,7 +2504,8 @@ ssize_t ib_uverbs_post_srq_recv(struct ib_uverbs_file *file,
		goto out;

	resp.bad_wr = 0;
	ret = srq->device->post_srq_recv(srq, wr, &bad_wr);
	ret = srq->device->post_srq_recv ?
		srq->device->post_srq_recv(srq, wr, &bad_wr) : -EOPNOTSUPP;

	uobj_put_obj_read(srq);

+3 −0
Original line number Diff line number Diff line
@@ -479,6 +479,9 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,
{
	struct ib_ah *ah;

	if (!pd->device->create_ah)
		return ERR_PTR(-EOPNOTSUPP);

	ah = pd->device->create_ah(pd, ah_attr, udata);

	if (!IS_ERR(ah)) {