Drivers now expose two callbacks for address handle creation, one for uverbs and one for kverbs. The function pointer NULL check in _rdma_create_ah() should only happen if !udata. A NULL check for .create_user_ah is not needed as it is validated by the uverbs uapi definitions. Fixes: 676a80adba01 ("RDMA: Remove AH from uverbs_cmd_mask") Signed-off-by: Gal Pressman <galpress@xxxxxxxxxx> --- drivers/infiniband/core/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index ab1e6048685e..33778f8674a1 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -516,7 +516,7 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd, might_sleep_if(flags & RDMA_CREATE_AH_SLEEPABLE); - if (!device->ops.create_ah) + if (!udata && !device->ops.create_ah) return ERR_PTR(-EOPNOTSUPP); ah = rdma_zalloc_drv_obj_gfp( -- 2.29.2