aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/iser/iscsi_iser.c
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2012-04-29 10:04:21 -0400
committerRoland Dreier <roland@purestorage.com>2012-05-18 20:05:31 -0400
commit7d9c0de4ab4ec00b8349d1af0b736a0d473671c2 (patch)
treeea98903ee548b01debd791d2294a3d9bd4df266a /drivers/infiniband/ulp/iser/iscsi_iser.c
parentd48b97b403d23f6df0b990cee652bdf9a52337a3 (diff)
IB/iser: Fix error flow in iser ep connection establishment
The current error flow code was releasing the IB connection object and calling iscsi_destroy_endpoint() directly without going through the reference counting mechanism introduced in commit 39ff05d ("IB/iser: Enhance disconnection logic for multi-pathing"). This resulted in a double free of the iscsi endpoint object, which causes a kernel NULL pointer dereference. Fix that by plugging into the IB conn reference counting correctly. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/iser/iscsi_iser.c')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index db43b3117168..0ab8c9cc3a78 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -573,10 +573,9 @@ iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
573 573
574 err = iser_connect(ib_conn, NULL, (struct sockaddr_in *)dst_addr, 574 err = iser_connect(ib_conn, NULL, (struct sockaddr_in *)dst_addr,
575 non_blocking); 575 non_blocking);
576 if (err) { 576 if (err)
577 iscsi_destroy_endpoint(ep);
578 return ERR_PTR(err); 577 return ERR_PTR(err);
579 } 578
580 return ep; 579 return ep;
581} 580}
582 581