Commit c7a5e0d0 authored by Manish Rangankar's avatar Manish Rangankar Committed by James Bottomley

[SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param.

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: default avatarManish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: default avatarVikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 1dc8ed5d
...@@ -1337,8 +1337,8 @@ static int qla4xxx_session_get_param(struct iscsi_cls_session *cls_sess, ...@@ -1337,8 +1337,8 @@ static int qla4xxx_session_get_param(struct iscsi_cls_session *cls_sess,
sess->password_in, BIDI_CHAP, sess->password_in, BIDI_CHAP,
&idx); &idx);
if (rval) if (rval)
return -EINVAL; len = sprintf(buf, "\n");
else
len = sprintf(buf, "%hu\n", idx); len = sprintf(buf, "%hu\n", idx);
break; break;
case ISCSI_PARAM_CHAP_OUT_IDX: case ISCSI_PARAM_CHAP_OUT_IDX:
...@@ -1346,8 +1346,8 @@ static int qla4xxx_session_get_param(struct iscsi_cls_session *cls_sess, ...@@ -1346,8 +1346,8 @@ static int qla4xxx_session_get_param(struct iscsi_cls_session *cls_sess,
sess->password, LOCAL_CHAP, sess->password, LOCAL_CHAP,
&idx); &idx);
if (rval) if (rval)
return -EINVAL; len = sprintf(buf, "\n");
else
len = sprintf(buf, "%hu\n", idx); len = sprintf(buf, "%hu\n", idx);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment