aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_qp.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 6a41fdbc8e57..b997ff88401b 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -835,7 +835,8 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
835 init_attr->qp_type); 835 init_attr->qp_type);
836 if (err) { 836 if (err) {
837 ret = ERR_PTR(err); 837 ret = ERR_PTR(err);
838 goto bail_rwq; 838 vfree(qp->r_rq.wq);
839 goto bail_qp;
839 } 840 }
840 qp->ip = NULL; 841 qp->ip = NULL;
841 ipath_reset_qp(qp); 842 ipath_reset_qp(qp);
@@ -863,7 +864,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
863 sizeof(offset)); 864 sizeof(offset));
864 if (err) { 865 if (err) {
865 ret = ERR_PTR(err); 866 ret = ERR_PTR(err);
866 goto bail_rwq; 867 goto bail_ip;
867 } 868 }
868 } else { 869 } else {
869 u32 s = sizeof(struct ipath_rwq) + 870 u32 s = sizeof(struct ipath_rwq) +
@@ -875,7 +876,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
875 qp->r_rq.wq); 876 qp->r_rq.wq);
876 if (!qp->ip) { 877 if (!qp->ip) {
877 ret = ERR_PTR(-ENOMEM); 878 ret = ERR_PTR(-ENOMEM);
878 goto bail_rwq; 879 goto bail_ip;
879 } 880 }
880 881
881 err = ib_copy_to_udata(udata, &(qp->ip->offset), 882 err = ib_copy_to_udata(udata, &(qp->ip->offset),
@@ -907,9 +908,11 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
907 goto bail; 908 goto bail;
908 909
909bail_ip: 910bail_ip:
910 kfree(qp->ip); 911 if (qp->ip)
911bail_rwq: 912 kref_put(&qp->ip->ref, ipath_release_mmap_info);
912 vfree(qp->r_rq.wq); 913 else
914 vfree(qp->r_rq.wq);
915 ipath_free_qp(&dev->qp_table, qp);
913bail_qp: 916bail_qp:
914 kfree(qp); 917 kfree(qp);
915bail_swq: 918bail_swq: