We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6feb64f commit 82305f8Copy full SHA for 82305f8
drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2942,10 +2942,8 @@ static int srpt_alloc_srq(struct srpt_device *sdev)
2942
srpt_alloc_ioctx_ring(sdev, sdev->srq_size,
2943
sizeof(*sdev->ioctx_ring[0]),
2944
srp_max_req_size, DMA_FROM_DEVICE);
2945
- if (!sdev->ioctx_ring) {
2946
- ib_destroy_srq(srq);
2947
- return -ENOMEM;
2948
- }
+ if (!sdev->ioctx_ring)
+ goto free_srq;
2949
2950
sdev->use_srq = true;
2951
sdev->srq = srq;
@@ -2956,6 +2954,10 @@ static int srpt_alloc_srq(struct srpt_device *sdev)
2956
2954
}
2957
2955
2958
return 0;
+
+free_srq:
2959
+ ib_destroy_srq(srq);
2960
+ return -ENOMEM;
2961
2962
2963
static int srpt_use_srq(struct srpt_device *sdev, bool use_srq)
0 commit comments