ktransport_ep_connect() (defined in open-iscsi/usr/netlink.c) returns -EIO if endpoint ID is 0. int ktransport_ep_connect(iscsi_conn_t *conn, int non_blocking) { ... rc = __kipc_call(iov, 2); if (rc < 0) return rc; if (!ev->r.ep_connect_ret.handle) return -EIO; conn->transport_ep_handle = ev->r.ep_connect_ret.handle; ... } Fixes: 3c6ae371b8a1 ("scsi: iscsi: Release endpoint ID when its freed") Signed-off-by: Varun Prakash <varun@xxxxxxxxxxx> --- drivers/scsi/scsi_transport_iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 2c0dd64159b0..5ad69c65cbe0 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -212,7 +212,7 @@ iscsi_create_endpoint(int dd_size) return NULL; mutex_lock(&iscsi_ep_idr_mutex); - id = idr_alloc(&iscsi_ep_idr, ep, 0, -1, GFP_NOIO); + id = idr_alloc(&iscsi_ep_idr, ep, 1, -1, GFP_NOIO); if (id < 0) { mutex_unlock(&iscsi_ep_idr_mutex); printk(KERN_ERR "Could not allocate endpoint ID. Error %d.\n", -- 2.27.0