On Sun, Aug 30, 2020 at 11:40:05AM +0300, Leon Romanovsky wrote: > -void mlx5_ib_destroy_srq(struct ib_srq *srq, struct ib_udata *udata) > +int mlx5_ib_destroy_srq(struct ib_srq *srq, struct ib_udata *udata) > { > struct mlx5_ib_dev *dev = to_mdev(srq->device); > struct mlx5_ib_srq *msrq = to_msrq(srq); > + int ret; > + > + ret = mlx5_cmd_destroy_srq(dev, &msrq->msrq); > + if (ret && udata) > + return ret; > > - mlx5_cmd_destroy_srq(dev, &msrq->msrq); > - > - if (srq->uobject) { > - mlx5_ib_db_unmap_user( > - rdma_udata_to_drv_context( > - udata, > - struct mlx5_ib_ucontext, > - ibucontext), > - &msrq->db); > - ib_umem_release(msrq->umem); > - } else { > - destroy_srq_kernel(dev, msrq); > + if (udata) { > + destroy_srq_user(srq->pd, msrq, udata); > + return 0; > } It is not a big deal but I would like to remove udata as an argument to the driver destroy functions, it is completely nonsensical and never used. Jason