From fab0ea06e231cd07a97a36859895d1d521dc6734 Mon Sep 17 00:00:00 2001 From: Yan Burman Date: Wed, 28 Jan 2015 12:16:26 +0000 Subject: [PATCH] isert: Properly propagate portal creation error to iscsi-scstd Signed-off-by: Yan Burman git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@6004 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_datamover.c | 7 +------ iscsi-scst/kernel/isert-scst/isert_login.c | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_datamover.c b/iscsi-scst/kernel/isert-scst/iser_datamover.c index 6ea9f8371..7c6809b6b 100644 --- a/iscsi-scst/kernel/isert-scst/iser_datamover.c +++ b/iscsi-scst/kernel/isert-scst/iser_datamover.c @@ -92,12 +92,7 @@ out: void *isert_portal_add(struct sockaddr *saddr, size_t addr_len) { - struct isert_portal *portal = isert_portal_start(saddr, addr_len); - - if (IS_ERR(portal)) - portal = NULL; - - return portal; + return isert_portal_start(saddr, addr_len); } int isert_portal_remove(void *portal_h) diff --git a/iscsi-scst/kernel/isert-scst/isert_login.c b/iscsi-scst/kernel/isert-scst/isert_login.c index 35c094433..e6a4ff9d9 100644 --- a/iscsi-scst/kernel/isert-scst/isert_login.c +++ b/iscsi-scst/kernel/isert-scst/isert_login.c @@ -409,10 +409,10 @@ static long isert_listen_ioctl(struct file *filp, unsigned int cmd, portal = isert_portal_add((struct sockaddr *)&dev->info.addr, dev->info.addr_len); - if (!portal) { + if (IS_ERR(portal)) { PRINT_ERROR("Unable to add portal of size %zu\n", dev->info.addr_len); - res = -EINVAL; + res = PTR_ERR(portal); goto out; } dev->portal_h[dev->free_portal_idx++] = portal;