]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param.
authorManish Rangankar <manish.rangankar@qlogic.com>
Mon, 21 Jan 2013 04:51:04 +0000 (23:51 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 30 Jan 2013 02:59:00 +0000 (13:59 +1100)
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.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/qla4xxx/ql4_os.c

index b8acc40d6f6ce7ffb676f25066da781df79e0ea7..6142729167f47ab47d75c5ae35646c7527e606f0 100644 (file)
@@ -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);