aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_std_types.c
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2018-07-23 15:25:08 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-07-24 13:34:55 -0600
commit6cd080a674a7adce97c0189c4579cf40782c2770 (patch)
treee6c74c8907fe3e551b4c20cc33e30159ee0c16d3 /drivers/infiniband/core/uverbs_std_types.c
parentIB/mlx5: Introduce flow steering matcher uapi object (diff)
downloadlinux-dev-6cd080a674a7adce97c0189c4579cf40782c2770.tar.xz
linux-dev-6cd080a674a7adce97c0189c4579cf40782c2770.zip
IB: Support ib_flow creation in drivers
This patch considers the case that ib_flow is created by some device driver with its specific parameters using the KABI infrastructure. In that case both QP and ib_uflow_resources might not be applicable. Downstream patches from this series use the above functionality. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_std_types.c')
-rw-r--r--drivers/infiniband/core/uverbs_std_types.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/core/uverbs_std_types.c b/drivers/infiniband/core/uverbs_std_types.c
index 718c8430d364..c1e0492cc78a 100644
--- a/drivers/infiniband/core/uverbs_std_types.c
+++ b/drivers/infiniband/core/uverbs_std_types.c
@@ -54,9 +54,10 @@ static int uverbs_free_flow(struct ib_uobject *uobject,
struct ib_qp *qp = flow->qp;
int ret;
- ret = qp->device->destroy_flow(flow);
+ ret = flow->device->destroy_flow(flow);
if (!ret) {
- atomic_dec(&qp->usecnt);
+ if (qp)
+ atomic_dec(&qp->usecnt);
ib_uverbs_flow_resources_free(uflow->resources);
}