Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1337,8 +1337,8 @@ 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, "\n");
		else
			len = sprintf(buf, "%hu\n", idx);
		break;
	case ISCSI_PARAM_CHAP_OUT_IDX:
@@ -1346,8 +1346,8 @@ static int qla4xxx_session_get_param(struct iscsi_cls_session *cls_sess,
					      sess->password, LOCAL_CHAP,
					      &idx);
		if (rval)
			return -EINVAL;

			len = sprintf(buf, "\n");
		else
			len = sprintf(buf, "%hu\n", idx);
		break;
	default: