Skip to content

Commit

Permalink
[SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Manish Rangankar authored and James Bottomley committed Jan 30, 2013
1 parent 1dc8ed5 commit c7a5e0d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/scsi/qla4xxx/ql4_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c7a5e0d

Please sign in to comment.