diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 16 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 1a53fd22aedf..d7acd4b62d6e 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
@@ -596,19 +596,28 @@ iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, | |||
596 | struct iser_conn *ib_conn; | 596 | struct iser_conn *ib_conn; |
597 | struct iscsi_endpoint *ep; | 597 | struct iscsi_endpoint *ep; |
598 | 598 | ||
599 | ep = iscsi_create_endpoint(sizeof(*ib_conn)); | 599 | ep = iscsi_create_endpoint(0); |
600 | if (!ep) | 600 | if (!ep) |
601 | return ERR_PTR(-ENOMEM); | 601 | return ERR_PTR(-ENOMEM); |
602 | 602 | ||
603 | ib_conn = ep->dd_data; | 603 | ib_conn = kzalloc(sizeof(*ib_conn), GFP_KERNEL); |
604 | if (!ib_conn) { | ||
605 | err = -ENOMEM; | ||
606 | goto failure; | ||
607 | } | ||
608 | |||
609 | ep->dd_data = ib_conn; | ||
604 | ib_conn->ep = ep; | 610 | ib_conn->ep = ep; |
605 | iser_conn_init(ib_conn); | 611 | iser_conn_init(ib_conn); |
606 | 612 | ||
607 | err = iser_connect(ib_conn, NULL, dst_addr, non_blocking); | 613 | err = iser_connect(ib_conn, NULL, dst_addr, non_blocking); |
608 | if (err) | 614 | if (err) |
609 | return ERR_PTR(err); | 615 | goto failure; |
610 | 616 | ||
611 | return ep; | 617 | return ep; |
618 | failure: | ||
619 | iscsi_destroy_endpoint(ep); | ||
620 | return ERR_PTR(err); | ||
612 | } | 621 | } |
613 | 622 | ||
614 | static int | 623 | static int |
@@ -658,6 +667,7 @@ iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep) | |||
658 | } else { | 667 | } else { |
659 | iser_conn_release(ib_conn); | 668 | iser_conn_release(ib_conn); |
660 | } | 669 | } |
670 | iscsi_destroy_endpoint(ep); | ||
661 | } | 671 | } |
662 | 672 | ||
663 | static umode_t iser_attr_is_visible(int param_type, int param) | 673 | static umode_t iser_attr_is_visible(int param_type, int param) |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 6c7d8ce7b016..fffb4ac4c6ac 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -620,7 +620,7 @@ void iser_conn_release(struct iser_conn *ib_conn) | |||
620 | rdma_destroy_id(ib_conn->cma_id); | 620 | rdma_destroy_id(ib_conn->cma_id); |
621 | ib_conn->cma_id = NULL; | 621 | ib_conn->cma_id = NULL; |
622 | } | 622 | } |
623 | iscsi_destroy_endpoint(ib_conn->ep); | 623 | kfree(ib_conn); |
624 | } | 624 | } |
625 | 625 | ||
626 | /** | 626 | /** |