Make sure the providers implement the verbs callbacks before calling
them, otherwise return -EOPNOTSUPP.
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
                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);
 
 
 {
        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)) {