summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorManish Rangankar <manish.rangankar@qlogic.com>2013-01-20 23:51:04 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-01-30 13:59:00 +1100
commitc7a5e0d0ebb01fa5f266ddbf8d3d95affcd0f336 (patch)
tree85d0213e2fb1c2cdd719cd5773a19a064de067cd /drivers/scsi/qla4xxx
parent1dc8ed5d3888dbec2d7b6530308f4aca9288f7ec (diff)
downloadlinux-c7a5e0d0ebb01fa5f266ddbf8d3d95affcd0f336.tar.bz2
[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>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index b8acc40d6f6c..6142729167f4 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -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);