[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: Manish Rangankar <manish.rangankar@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Родитель
1dc8ed5d38
Коммит
c7a5e0d0eb
|
@ -1337,18 +1337,18 @@ 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:
|
||||||
rval = qla4xxx_get_chap_index(ha, sess->username,
|
rval = qla4xxx_get_chap_index(ha, sess->username,
|
||||||
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:
|
||||||
return iscsi_session_get_param(cls_sess, param, buf);
|
return iscsi_session_get_param(cls_sess, param, buf);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче