From: Manish Rangankar <manish.rangan...@qlogic.com>

While reading sysfs chap_in_idx and chap_out_idx attribute, if chap
authentication is not set we get an error as "Invalid argument".

Signed-off-by: Manish Rangankar <manish.rangan...@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudh...@qlogic.com>
---
 drivers/scsi/qla4xxx/ql4_os.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index b8acc40..6142729 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1337,18 +1337,18 @@ static int qla4xxx_session_get_param(struct 
iscsi_cls_session *cls_sess,
                                              sess->password_in, BIDI_CHAP,
                                              &idx);
                if (rval)
-                       return -EINVAL;
-
-               len = sprintf(buf, "%hu\n", idx);
+                       len = sprintf(buf, "\n");
+               else
+                       len = sprintf(buf, "%hu\n", idx);
                break;
        case ISCSI_PARAM_CHAP_OUT_IDX:
                rval = qla4xxx_get_chap_index(ha, sess->username,
                                              sess->password, LOCAL_CHAP,
                                              &idx);
                if (rval)
-                       return -EINVAL;
-
-               len = sprintf(buf, "%hu\n", idx);
+                       len = sprintf(buf, "\n");
+               else
+                       len = sprintf(buf, "%hu\n", idx);
                break;
        default:
                return iscsi_session_get_param(cls_sess, param, buf);
-- 
1.7.8.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to