aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2006-07-17 11:20:51 -0400
committerRoland Dreier <rolandd@cisco.com>2006-07-23 18:16:03 -0400
commitec924b4726e3df000d3ac7ae10cb8ef1adcd60ca (patch)
treeaccdb41bc62c0c60a209dad677fc04e4f1ddd132 /drivers/infiniband
parentabb5a5cc6bba1516403146c5b79036fe843beb70 (diff)
IB/uverbs: Fix unlocking in error paths
ib_uverbs_create_ah() and ib_uverbs_create_srq() did not release the PD's read lock in their error paths, which lead to deadlock when destroying the PD. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index bdf5d5098190..0371806cf398 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1775,7 +1775,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
1775 ah = ib_create_ah(pd, &attr); 1775 ah = ib_create_ah(pd, &attr);
1776 if (IS_ERR(ah)) { 1776 if (IS_ERR(ah)) {
1777 ret = PTR_ERR(ah); 1777 ret = PTR_ERR(ah);
1778 goto err; 1778 goto err_put;
1779 } 1779 }
1780 1780
1781 ah->uobject = uobj; 1781 ah->uobject = uobj;
@@ -1811,6 +1811,9 @@ err_copy:
1811err_destroy: 1811err_destroy:
1812 ib_destroy_ah(ah); 1812 ib_destroy_ah(ah);
1813 1813
1814err_put:
1815 put_pd_read(pd);
1816
1814err: 1817err:
1815 put_uobj_write(uobj); 1818 put_uobj_write(uobj);
1816 return ret; 1819 return ret;
@@ -1984,7 +1987,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
1984 srq = pd->device->create_srq(pd, &attr, &udata); 1987 srq = pd->device->create_srq(pd, &attr, &udata);
1985 if (IS_ERR(srq)) { 1988 if (IS_ERR(srq)) {
1986 ret = PTR_ERR(srq); 1989 ret = PTR_ERR(srq);
1987 goto err; 1990 goto err_put;
1988 } 1991 }
1989 1992
1990 srq->device = pd->device; 1993 srq->device = pd->device;
@@ -2029,6 +2032,9 @@ err_copy:
2029err_destroy: 2032err_destroy:
2030 ib_destroy_srq(srq); 2033 ib_destroy_srq(srq);
2031 2034
2035err_put:
2036 put_pd_read(pd);
2037
2032err: 2038err:
2033 put_uobj_write(&obj->uobject); 2039 put_uobj_write(&obj->uobject);
2034 return ret; 2040 return ret;